My First C Program


You need software to write your C programs. DevC++ and Codeblocks are popular open-source software which you can use to write, compile and execute C programs. You have to save your program with .c extension. Write program code into your software and save it with file name : program1.c 

After saving your program, you have to compile your program and then you can run it. In DevC++, short cut for compiling and running your program is F11. Try following C program which prints message "Hello Students".



// My first C Program

#include<stdio.h>
void main()
{
    printf("Hello Students");
}


This program will prints following output:

Hello Students 


You can also write your main ( ) function as under:


// My first C Program

int main()
{
    printf("Hello Students");
    return 0;



This program will print same output as shown in previous program:

Hello Students 



* * * * *

4 comments:

  1. This is extremely helpful information. Great work. It is very interesting to learn and easy to understood. Thanks for sharing information. Please let us know and more information . If you guys interested to learn C programming join c programming classes in pune.

    ReplyDelete