This is the most basic program in any programming language...

 

 

#include                                                              // Header file

#include                                                             // Header file

void main()                                                                         // Main function

{

int a,b;                                                                                 // Define variables

clrscr()                                                                                 // Clear screen

printf(" Enter the first number: \n");

scanf("%d",&a);                                                                  // Input augend

printf(" Enter the second number: \n");

scanf("%d",&b);                                                                  // Input addend

a=a+b;                                                                                 // Addition Operation

printf(" The result is : %d ",a);                                           // Print the result

getch();

}

**************************************************** Output ****************************************************

Enter the first number: 5

Enter the second number: 8

The result is: 13

 


Like it on Facebook, Tweet it or share this article on other bookmarking websites.

No comments