FUNCTIONS

#include (Pre-processor directive)

Pre processor directive is a directive which is executed at the starting of the program. This directive contains # symbol and include statement (#include). This include statement is used to include any file in your program. This file can be library file or user defined file. When we use #include, this statement then pre processor tells the compiler to include the content of stdio.h because this file contains all the standard input and output functions in it.

void main ( )

This function tells the compiler for the entry point of the program. Without the main function out program cannot run and the body of the function is written in these curly braces [ { } ] and these curly braces contains number of statements, functions and expressions, keyword etc. in it. Void is a data type which tells the compiler that our main function is not returning any value to any other program of functions.

printf ( )

This function is pre defined function which is defined in our header file called standard input/output file. By using this function, we can display any constant message or any variable value on the screen. Printf stands for print format.

clrscr ( )

This function is used to clear our output screen because it remains or displays the output of last executable program and this function clears our output screen before displaying any message on the screen and this function should be used in main function. Before the declaration of variables this function will not work and this function is in conio.h file.

Stdio.h

It stands for standard input output header file. This file includes all type of input/output functions. For example:-

printf ( ), scanf ( ) etc.

//wap to print addition of two constants

#include

void main ( );

{

const int a=20;

const int b=30;

int c;

clrscr ( );

c=a+b;

printf (“Sum is %d”,c);

}