If you are a Computer Programmer, you will definitely come across "Hello World" Programs in your life time. Never-mind the languages most of us start our learning process from a new "Hello World" Program. Here too i am not changing normal starting for learning....
As basic structure of C Programs tell, it should contain
As basic structure of C Programs tell, it should contain
- Documentation Part (Optional)
- Preprocessor Statement ( we can call it as Header Files)
- Global Declaration (If any..)
- Main () function
- Curly Braces
- Local Declaration
- Program Statement (optional)
- Functions (Optional)
We can discuss about the Basic Structure of C in our later posts.
now we can try to write a "Hello World".C Program using this basic structure.
//Documentation Part
//Author : www.invatac.com
//Preprocessor Statement
#include <stdio.h>
int main(void)
{
printf("\n Hello World \n");
return 0;
}
Now Save this program as helloworld.c
compile and run the program
Result You will get will be :
Hello World
If you are Linux user and don't know to compile your C Program
then Follow this tutorial : Compile C Program in Linux
happy Programming :)
No comments:
Post a Comment