Introduction To Computer Programming: Unit I
Introduction To Computer Programming: Unit I
COMPUTER PROGRAMMING
UNIT I
Main function
One and only one in entire program.
Start function in a program.
Header file
Provided by the system or created by the programmer.
ASCII file that contains functions, variable declarations, definitions
The basic stages of a C program: source code, object code, executable code.
Types of Comments:
/* */ - C-style comments for multiline comments
/* this is an example of a
C style or multiline comments */
// - C++ style comments for single line comments
// This is a C++ style or single line comments
COMSCI 1101 - COMPUTER PROGRAMMING I
PROGRAM STATEMENTS AND BLOCKS
STATEMENT is one or more lines of code terminated by a semicolon.
printf(“Hello world!”);
sum = num1+num2;
BLOCK is one or more statements bounded by an opening and closing
curly braces that groups the statements as one unit.
int main( ) {
printf ("Hello");
printf ("world!");
}
return 0;
firstNumber, thisIsAnExampleOfFunctionName