Thursday, 3 September 2020

First c program

 first c program

Before starting the abcd of C language, you need to learn how to write, compile and run the first c program.

To write the first c program, open the C console and write the following code:


  1. #include <stdio.h> 
  2. #include <conio.h>   
  3. int main()
  4. {    
  5. printf("Hello ecodepoint");    
  6. return 0;   
  7. }  

#include is the first word of any C program

#include <stdio.h> includes the standard input output library functions.

int main() The main() function is the entry point of every program in c language.

return 0 The return 0 statement, returns execution status to the OS. The 0 value is used for successful execution and 1 for unsuccessful execution.

Best compile and run the c program.


Hello ecodepoint                                                                                                              
                                                                                                                              
...Program finished with exit code 0                                                                                          
Press ENTER to exit console.                                                                                                  
                                      


No comments:

Post a Comment

Variables in C

What is variables:- A  variable  is nothing but a name given to a storage area that our programs can manipulate. Each  variable in C  has a ...