DOWNLOAD TURBO C
Basic structure of "C":-
Let us make a sample program that can print "hello world" in the output..
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
printf("Hello World");
getch();
}
Output:-
Hello World
let us discuss this program line by line.
"#include" means that this is instructions for the compiler and "<stdio.h>" means standard input output header file.
"<conio.h>" means control input output header file.
"void main(void)" is actually the name of the function which name is "main" and it is compulsory in all the programs.
C language structure looks difficult in the begging but once you get started you will observe that it is very easy.
Now after main function there will be always parentheses and rest of the program will be written under it.
"clrscr();" command is used to clear all the previous output on the screen so that there should be only new output on the screen.
"printf(" ");" this statement is used to write output on the screen what ever you will write under inverted commas it will be print on the screen as it is.
"getch();" this statement is used to hold the output on the screen so that you can see your output.
NOTE:- This program is only to show the structure of C language and we will discuss all the aspects step by step so there is no need to be worry this is only a sample.
Basic structure of "C":-
Let us make a sample program that can print "hello world" in the output..
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
printf("Hello World");
getch();
}
Output:-
Hello World
let us discuss this program line by line.
"#include" means that this is instructions for the compiler and "<stdio.h>" means standard input output header file.
"<conio.h>" means control input output header file.
"void main(void)" is actually the name of the function which name is "main" and it is compulsory in all the programs.
C language structure looks difficult in the begging but once you get started you will observe that it is very easy.
Now after main function there will be always parentheses and rest of the program will be written under it.
"clrscr();" command is used to clear all the previous output on the screen so that there should be only new output on the screen.
"printf(" ");" this statement is used to write output on the screen what ever you will write under inverted commas it will be print on the screen as it is.
"getch();" this statement is used to hold the output on the screen so that you can see your output.
NOTE:- This program is only to show the structure of C language and we will discuss all the aspects step by step so there is no need to be worry this is only a sample.
No comments:
Post a Comment