Computer Science and Engineering covers the basics of computers and C programming over 5 units. Unit 1 discusses fundamentals of computers including components, classifications, and number systems. Unit 2 covers algorithms, flowcharts, and pseudo code as well as the basics of the C programming language. Unit 3 discusses arrays and functions. Unit 4 focuses on strings and pointers. Unit 5 examines structures, unions, and file handling in C. The course aims to provide students with a foundation in computer fundamentals and an introduction to programming in C.
The document introduces different types of loops in C programming including while, for, and do-while loops. It explains that loops allow repeated execution of a block of code until a certain condition is met. The key types of loops are pretest and post-test loops, which differ in when the loop condition is evaluated. It provides examples of implementing various loops in C and using concepts like initialization, updating, nesting, and break/continue statements.
C tokens are the smallest indivisible units in a C program recognized by the compiler. There are different types of tokens including keywords, identifiers, constants, strings, special symbols, and operators. The C character set includes letters, digits, and special characters. Identifiers are distinct names given to program elements and must start with a letter or underscore, cannot contain spaces or commas, and are case-sensitive. C has 32 predefined keywords that have special meaning and cannot be reused. Data types define a set of values and operations that can be performed on them.
1. C programs consist of functions that perform specific tasks. The main() function is where program execution begins.
2. This example program prints "Welcome to C" by using functions like printf() to output text and getch() to pause the program.
3. The #include directives tell the compiler to include header files containing declarations for functions like printf() and clrscr() that are used in the program.
This document contains 14 chapters with programming examples in C language. Chapter 1 includes basic programs to print name, address and patterns. Chapter 2 covers programs on calculations, loops and conditional statements. Later chapters introduce more advanced concepts like functions, arrays, pointers and file handling. The document serves as a learning guide for beginners to practice and learn basic to intermediate C programming skills.
This document outlines the course content for a Programming in C++ course, including 12 topics that will be covered: 1) principles of object oriented programming, 2) beginning with C++, 3) tokens, expressions, and control structures, 4) functions in C++, 5) classes and objects, 6) constructors and destructors, 7) operator overloading and type conversions, 8) inheritance, 9) pointers, virtual functions and polymorphism, 10) managing console I/O operations, 11) working with files, and 12) templates and exception handling. Students will write programs based on the curriculum and six reference books are provided.
The document discusses storage classes in C which determine where a variable is stored in memory and how long it exists. There are four main storage classes: automatic, register, static, and external. Automatic is the default and variables exist for the duration of the block they are declared in. Register variables store in CPU registers but cannot be used with scanf. Static variables retain their value between function calls while existing in the block. External variables are global and visible throughout a program.
The document discusses algorithms, pseudocode, and flowcharts. It defines an algorithm as a set of precise, unambiguous steps to accomplish a task. Pseudocode uses plain language to represent program logic and includes structures like sequence, selection, and iteration. A flowchart visually depicts a program's flow using standard symbols like rectangles, diamonds, and arrows. It provides examples of algorithms, pseudocode, and a basic payroll calculation flowchart.
Computer Science and Engineering covers the basics of computers and C programming over 5 units. Unit 1 discusses fundamentals of computers including components, classifications, and number systems. Unit 2 covers algorithms, flowcharts, and pseudo code as well as the basics of the C programming language. Unit 3 discusses arrays and functions. Unit 4 focuses on strings and pointers. Unit 5 examines structures, unions, and file handling in C. The course aims to provide students with a foundation in computer fundamentals and an introduction to programming in C.
The document introduces different types of loops in C programming including while, for, and do-while loops. It explains that loops allow repeated execution of a block of code until a certain condition is met. The key types of loops are pretest and post-test loops, which differ in when the loop condition is evaluated. It provides examples of implementing various loops in C and using concepts like initialization, updating, nesting, and break/continue statements.
C tokens are the smallest indivisible units in a C program recognized by the compiler. There are different types of tokens including keywords, identifiers, constants, strings, special symbols, and operators. The C character set includes letters, digits, and special characters. Identifiers are distinct names given to program elements and must start with a letter or underscore, cannot contain spaces or commas, and are case-sensitive. C has 32 predefined keywords that have special meaning and cannot be reused. Data types define a set of values and operations that can be performed on them.
1. C programs consist of functions that perform specific tasks. The main() function is where program execution begins.
2. This example program prints "Welcome to C" by using functions like printf() to output text and getch() to pause the program.
3. The #include directives tell the compiler to include header files containing declarations for functions like printf() and clrscr() that are used in the program.
This document contains 14 chapters with programming examples in C language. Chapter 1 includes basic programs to print name, address and patterns. Chapter 2 covers programs on calculations, loops and conditional statements. Later chapters introduce more advanced concepts like functions, arrays, pointers and file handling. The document serves as a learning guide for beginners to practice and learn basic to intermediate C programming skills.
This document outlines the course content for a Programming in C++ course, including 12 topics that will be covered: 1) principles of object oriented programming, 2) beginning with C++, 3) tokens, expressions, and control structures, 4) functions in C++, 5) classes and objects, 6) constructors and destructors, 7) operator overloading and type conversions, 8) inheritance, 9) pointers, virtual functions and polymorphism, 10) managing console I/O operations, 11) working with files, and 12) templates and exception handling. Students will write programs based on the curriculum and six reference books are provided.
The document discusses storage classes in C which determine where a variable is stored in memory and how long it exists. There are four main storage classes: automatic, register, static, and external. Automatic is the default and variables exist for the duration of the block they are declared in. Register variables store in CPU registers but cannot be used with scanf. Static variables retain their value between function calls while existing in the block. External variables are global and visible throughout a program.
The document discusses algorithms, pseudocode, and flowcharts. It defines an algorithm as a set of precise, unambiguous steps to accomplish a task. Pseudocode uses plain language to represent program logic and includes structures like sequence, selection, and iteration. A flowchart visually depicts a program's flow using standard symbols like rectangles, diamonds, and arrows. It provides examples of algorithms, pseudocode, and a basic payroll calculation flowchart.
Computer languages can be categorized into high-level languages, low-level languages, and machine language. High-level languages are closer to human language and require compilers or interpreters, while low-level languages like assembly language are closer to machine language. Machine language is binary code that is directly executable by computers. There are also different generations of languages that evolved with advances in hardware and software.
The document discusses different number systems including positional and non-positional systems. It covers the decimal, binary, octal and hexadecimal number systems in detail. Key points include:
1) Positional systems use the place value of digits to represent numbers, with the decimal and binary systems being examples.
2) Converting between number bases involves repeatedly dividing the number by the new base and recording the remainders as digits.
3) Binary, octal and hexadecimal use groups of bits/digits to simplify conversions between the bases.
4) Floating point numbers represent real numbers with a mantissa and exponent in positional notation.
Computer languages can be categorized into high-level languages, low-level languages, and machine language. High-level languages are easier for humans to read and write but require compilers or interpreters, while low-level languages like assembly language are closer to machine language but still use symbolic instructions. Machine language uses only binary and is directly executable by computers. Languages have evolved through five generations from low-level machine and assembly languages to modern high-level languages.
This document discusses different types of computers including analog, digital, and hybrid computers. It describes the key characteristics of microcomputers, mainframe computers, supercomputers, mini computers, desktop PCs, laptops, and handheld devices. The document also discusses dumb terminals, intelligent terminals, and provides examples of Indian supercomputers like PARAM and applications of computers in various fields.
The document outlines the main components of a computer system. It discusses the motherboard, which connects all the parts together including the CPU, memory, storage devices and ports. Storage devices mentioned include hard disk drives, floppy disks, and other external storage. Input devices include the keyboard, mouse, scanner, and microphone. Output devices include monitors to display visual output, speakers for audio, and printers. Other peripherals that enhance functionality are modems, digital cameras, sound cards and video cards.
The document provides an introduction to computers and computer generations. It defines what a computer is and describes the basic components of a computer including input, output, memory, CPU, and control units. It then outlines the five generations of computers, from the first generation that used vacuum tubes to the current fifth generation using ULSI chips. Each generation is characterized by major technological developments that improved computer size, speed, memory, and processing power.
Here are the key points about scanf():
- scanf() is used to read/input values from the keyboard or standard input device.
- It follows the same format specifier conventions as printf() for data types (%d for int, %f for float, %c for char etc).
- The address of operator & is used before variables in the argument list to tell scanf() to store the input directly into the memory location of the variables.
- This is necessary because normally function arguments in C are passed by value, so scanf() would just get a copy of the variable instead of modifying the original one. The & takes the address to allow direct modification.
So in summary, scanf
Computer languages can be categorized into high-level languages, low-level languages, and machine language. High-level languages are closer to human language and require compilers or interpreters, while low-level languages like assembly language are closer to machine language. Machine language is binary code that is directly executable by computers. There are also different generations of languages that evolved with advances in hardware and software.
The document discusses different number systems including positional and non-positional systems. It covers the decimal, binary, octal and hexadecimal number systems in detail. Key points include:
1) Positional systems use the place value of digits to represent numbers, with the decimal and binary systems being examples.
2) Converting between number bases involves repeatedly dividing the number by the new base and recording the remainders as digits.
3) Binary, octal and hexadecimal use groups of bits/digits to simplify conversions between the bases.
4) Floating point numbers represent real numbers with a mantissa and exponent in positional notation.
Computer languages can be categorized into high-level languages, low-level languages, and machine language. High-level languages are easier for humans to read and write but require compilers or interpreters, while low-level languages like assembly language are closer to machine language but still use symbolic instructions. Machine language uses only binary and is directly executable by computers. Languages have evolved through five generations from low-level machine and assembly languages to modern high-level languages.
This document discusses different types of computers including analog, digital, and hybrid computers. It describes the key characteristics of microcomputers, mainframe computers, supercomputers, mini computers, desktop PCs, laptops, and handheld devices. The document also discusses dumb terminals, intelligent terminals, and provides examples of Indian supercomputers like PARAM and applications of computers in various fields.
The document outlines the main components of a computer system. It discusses the motherboard, which connects all the parts together including the CPU, memory, storage devices and ports. Storage devices mentioned include hard disk drives, floppy disks, and other external storage. Input devices include the keyboard, mouse, scanner, and microphone. Output devices include monitors to display visual output, speakers for audio, and printers. Other peripherals that enhance functionality are modems, digital cameras, sound cards and video cards.
The document provides an introduction to computers and computer generations. It defines what a computer is and describes the basic components of a computer including input, output, memory, CPU, and control units. It then outlines the five generations of computers, from the first generation that used vacuum tubes to the current fifth generation using ULSI chips. Each generation is characterized by major technological developments that improved computer size, speed, memory, and processing power.
Here are the key points about scanf():
- scanf() is used to read/input values from the keyboard or standard input device.
- It follows the same format specifier conventions as printf() for data types (%d for int, %f for float, %c for char etc).
- The address of operator & is used before variables in the argument list to tell scanf() to store the input directly into the memory location of the variables.
- This is necessary because normally function arguments in C are passed by value, so scanf() would just get a copy of the variable instead of modifying the original one. The & takes the address to allow direct modification.
So in summary, scanf