We will use a C program to take two numbers from the user and calculate their sum. I would like to request you to try to code it yourself, if you can’t then check out this solution (Arithmetic Operator).
#include
//c programm find sum of two numbers
int main(){
int num1, num2, sum;
//user enter 1st number store number num1 variable
printf("Enter 1st Number:- ");
scanf("%d",&num1);
//user enter 2nd number store number num2 variable
printf("Enter 2nd Number:- ");
scanf("%d",&num2);
//Adding both number is simple and fundamental
sum = num1 + num2;
//print the sum of two number
printf("Sum is = %d", sum);
return 0;
}
Table of Contents
ToggleC Program Add Two Numbers
Output:-
