Pages

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 C software and save it as: 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".

Program Code 1

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

Output of Program

  Hello Students

You can also write your main ( ) function as shown below:

Program Code 2

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

Output of Program

  Hello Students

Program code 1 and code 2 will print same output.

* * * * * 

How to write first C Program using Dev C++ software


Watch C Programming Video Tutorial at

YouTube Channel @SelfStudyTutorials


* * * * *
Back to Home

Next - Looping Page




4 comments: