Addition of two numbers by user input:-
In this c program we will see that how to add two integer numbers by user input values using in-built function scanf with the help of num1, num2 and add three int type variables.
/*
Program : Addition Of Two Number User Input
Filename : addUserInput.c
IDE Used To Developed : CodeBlocks
Developed By : Pavito Golui
*/
#include<stdio.h>
int main()
{
int num1, num2, add;
printf("Enter the first number :");
scanf("%d",&num1);
printf("Enter the second number :");
scanf("%d",&num2);
add=num1+num2;
printf("Addition of %d and %d is %d",num1,num2,add);
return 0;
}
Program : Addition Of Two Number User Input
Filename : addUserInput.c
IDE Used To Developed : CodeBlocks
Developed By : Pavito Golui
*/
#include<stdio.h>
int main()
{
int num1, num2, add;
printf("Enter the first number :");
scanf("%d",&num1);
printf("Enter the second number :");
scanf("%d",&num2);
add=num1+num2;
printf("Addition of %d and %d is %d",num1,num2,add);
return 0;
}
Output :
Enter the first number : 110
Enter the second number :250
Addition of 110 and 250 is 360
0 comments:
Welcome to you in All Coding Help