A simple c program :-
# include stdio
# include conio
void main()
{
printf("5");
}
Do you beleive this simple C program covers almost 10% of c.
Now three qution arises :-
1. what is conio.h
2. what is void main() and why we are using it ?
3. what is printf option?
To get the answers of these three qution we will perform some tricks :-
1. We remove (# include conio.h
We remove ( # include stdio.h
2. Now, i wanna tell you that we are using void main because our compiler use it as a main gate of the program.We usually think that program start from #include files ....NO i waanna tell you that this is misconception. Compiler always search main function in the program and if it does'nt find it program becomes unexecutable.
3. Now you are thinking that what is the use of printf function. I just wanna tell you that you will understand it better if use you will use different things in printf for eg in my program i am using 5 in printf you can use any statement at the place of 5.
look here =>
printf("i am hero"); or printf("i am hero heralal no.1"); or printf("i proud to be indian"); anything you want.....and i want you to play with it. As much as you will play as much you will enjoy. But remmember the format (" "); now please don'nt ask why?
No comments:
Post a Comment