C Language



Admission Enquiry Form

  

First C Program





First Program in C

Before starting to learn C Language, you must know about how to write the first program or we can say, the structure of first c program.
For writing the first C program you have to open the IDE which is available to you.Now start to write the following code on code editor.



Output

Welcome you in CThanks to join COMPUHELP



Explanation of First C program

Here,//First C program The first line of the program begins with // which represents that any text written after these // symbols is a comment. While running the program ,Comment does not effect the program bacause comments are ignored by the compiler.The comments are used by the programmer to write the description or detail of the program to understands the code easily in future.

#include<stdio.h> is the header file in which standard input output library functions are included. stdio.h header file includes the definition of printf().

#include<conio.h> is the header file in which console input output library functions are included. conio.h header file includes the definition of getch().

void main(), is the main function from where the execution start of every c program.So, this is the entry point of every c program.

() are called the paranthesis. The word written with these () or paranthesis is called a function. And the value written inside these () is called the arguments of the function. As you can see inside printf("Welcome you in C"), this statement i.e. welcome you in C is the argument which is taken by printf() is of type string.In c programming string is always written inside the double quotes ("").

{ }- These are curly braces which are called as { -> beginning block of statement and } -> this is ending block of statements.

printf() , The printf() function is used to print the data on console and is responsible to give output.

; This semicolon ; is called the the statement terminator which tells the compiler that statement ends.

getch() , The getch() function is used to hold the output screen till you will not enter any character from the keyboard.