Skip to main content

Posts

Showing posts with the label Sum of two integers in C

Sum of two numbers in C Language Program Source Code Free with Explanations...

// Sum of two numbers in C Language Program Source Code :- #include<stdio.h> #include<conio.h> void main() { int num1,num2,sum_num; // int means integer variable declaration clrscr(); // clear the screen printf("Enter First integer number :"); scanf("%d",&num1); // %d is to read an integer number from keyboard printf("Enter Second integer number :"); scanf("%d",&num2); sum_num=num1+num2; // calculating sum of given numbers printf("Sum of %d and %d = %d",num1,num2,sum_num); getch(); /* it is used for to wait the output screen upto getting any character from keyboard */ } /* Save file as "anyname.c" and Run using Ctrl+F9. Example:- If first number is given 23 and second number is given 57 then the output will be as :- Sum of 23 and 57 = 80 */