Hello world in C

Hello friends , this is our first program in c i.e  displaying hello world in C. The code for displaying hello world is given below you can copy it by clicking copy button and paste it is codeblock ( Desktop ) or mobile C . Then click on build and run  from codeblock menu after that it will run and show an output " hello world " .


 



  Explanation of code

First line #include<stdio.h> includes standard input output header file , what is headerfile ? we will learn it later but for now i want to tell you stdio.h contains functions for taking input or writing output on screen like printf(), scanf().

Second line int main(){   is starting of main function , main function is function which runs first on c file , every c file must contain one and only main function strictly. where main is function name and int is return type , we will learn about return type in function chapter.

Thirdly printf("Hello world");  It displays hello world on computer screen , it is standard output function we will learn about it later.

lastly return 0;  it returns 0 to main function , Main function had return type int i.e integer so we returned 0 to tell computer that program has run successfully .





Contact Form

Name

Email *

Message *