Program to find sum of given two integer numbers.
Explanation :
Read two integers a and b using int(input())
Assign C variable to a+b c=a+b
print the value of c.
PROGRAM IN C LANGUAGE
PROGRAM IN C LANGUAGE
#include
int main(){
int num1,num2,sum_of_two;
scanf("%d %d",&num1,&num2);
sum_of_two=num1+num2;
printf("sum of two nums is %d",sum_of_two);
return 0;
}
Output :
sum of two nums is 11
PROGRAM IN PYTHON LANGUAGE
num1=int(input())
num2=int(input())
sum_of_two = num1+num2
print("sum of two nums is ",sum_of_two)
Output :
sum of two nums is 11
Comments
Post a Comment
Type Your Comments !
Please do not enter any spam link in the comment box.