A Simple 'C' program:
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("Hello All");
printf("\nWelcome to C programming");
getch();
}
Step-by-step demonstration of the above program:
- #include - This is the pre processor directive and it attached the given header file with our program during compilation time.
- main() - It indicates that the program has begun now.
- {....} - It indicates a block.
- clrscr() - It is a library function , defined inside 'conio' header file which clears the screen at run time.
- printf() - This is also a library function defined inside 'stdio' header file which prints the given message on the output window.
- \n - This is known as line feed character and it breaks the message into separate lines.
- getch() - This is also a library function which pauses our output.
- ; - This symbol (semi-colon) is known as statement terminator and it indicates the compiler that the statement is end now.
Comments
Post a Comment