C Program Add Two Number

C Program Add Two Number

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<stdio.h>

//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;
}
				
			

C Program Add Two Numbers

Output:-

c program add two numbers

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *