THE FIRST PROGRAM

Write a program which takes the input from the user and performs addition of two numbers??

Answer

//This is our First program//       

#include<stdio.h>        // Header files or as a beginner you can say it is folder ,

                                       "#" symbol is preprocessor or it is also called "POUND"//

int main()               // Every program begains its excecution from main()//
{
// Variable declaration//
int a, b, sum;       

{
printf("Enter two nos. :");        //printf() it is used to print any message on consloe but

                                                  the condition is it should be written in like this "Your message"//

// Take two numbers as input from the user//
scanf("%d %d", &a, &b);

}
// Add the numbers and assign the value to some variable //

 

sum = a + b;

// Use the calculated value sum//

printf("your sum is  %d\n", sum);
return 0;

// End of program
}
 

Output -: 

Enter two nos. 5  8

your sum is  13

0Comment