C Program Structure
Before going into the C program language, you need to learn C program structure.
C program primarily divided into 5 parts
- Preprocessor
- Functions
- Variables
- Statements & Expressions.
- Comments

Simple C Program
To write simple c program with an explanation of the C program structure.
#include<stdio.h>
void main() {
/* Simple C program */
printf("Hello World!");
}
- #include is preprocessor command. It is standard input output library functions.
- int main() is main function where the program start execution.
- /* ... */ is comment line which ignored by the compiler.
- printf(...) is display print data on the screen.
- return 0; statement is terminates the main() function. 0 and 1 value are successful and unsucessful execution.
Additional Information
- #include is used for performing console input and output functions.
- Void main() - This function does not return a value in the program.
- Printf() - It is a predefined function, we can print the data or user defined message on the monitor. It can take any number of arguments with in double quotes (“ “) and every argument should be separated with comma within the double quotes.
- Getch() - It is used to hold the screen in simple language if you don’t write this screen will just flash and go away. By using this function we can read a character directly from the keyboard.
Quickly Find What You Are Looking For
OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.
point.com