Lect 3 Programming Logic Using ‘C’ C Program Structure
Lect 3 Programming Logic Using ‘C’ C Program Structure
BCAC0001
Lect-3 C Program Structure
Presented by:
Atul Kumar Uttam
Assistant Professor
Computer Engineering & Applications Department,
GLA University, Mathura
[email protected], +91-8979593001
C Program Structure
/*Comments*/ Optional, description of program
preprocessing commands To include header files, macro declaration
global Declarations; Optional, declare variables common to all functions
int main() Entry point of the program
{
Compulsory, user defined functions,
local declaration; start point of the program
executable statements;
Body of main function
-
return 0;
}
user defined functions()
{ Optional
fun definition
BCAC0001 Programming Logic using C :
} Atul Kr Uttam
A simple C program
#include<stdio.h>
int main(void)
{
printf(“Hello World”);
return 0;
}
printf(), scanf()