The file name of c program must be with .c extension.
Note: Turbo c compiler (windows platform) follows ANSI C standard.
And GCC (LINUX platform) follows a C99 standard.
- Definition of program present in libraries.
- Function call present in our program.
A simple structure of C- program :
#include<header_file>
function_declaration;
global_varables;
main( )
{
local variables;
program logic;
}
Example:
#include<stdio.h> //header file
#include<conio.h>
main() //main function
{
int a; //local variable
printf(“enter a number :”); //program logic
scanf(“%d \n”, a);
printf(” you’ve entered : %d “,a);
}
Leave a Reply