C program to enter two numbers and find their sum.
#include<stdio.h>
main()
{
int a,b,Sum;
printf("Enter the value of a and b : ");
scanf("%d %d",&a,&b);
Sum=a+b;
printf("Sum=%d",Sum);
}
OUT PUT
Enter the value of a and b : 5
5
Sum=10
--------------------------------
***********************************************************************************
// enter two numbers and find their sum.
#include<stdio.h>
main()
{
int a,b,Sum;
printf("Enter first number: ");
scanf("%d",&a);
printf("Enter secand number: ");
scanf("%d",&b);
Sum=a+b;
printf("Sum=%d",Sum);
}
OUT PUT
Enter first number: 5
Enter secand number: 5
Sum=10
------------------------
*****************************************
Related Question
➤Write a C program to perform input/output of all basic data types.
➤Write a C program to enter two numbers and find their sum.
➤Write a C program to enter two numbers and perform all arithmetic operations.
➤Write a C program to enter length and breadth of a rectangle and find its perimeter.
➤Write a C program to enter length and breadth of a rectangle and find its area.
➤Write a C program to enter radius of a circle and find its diameter, circumference
and area.
➤Write a C program to enter length in centimeter and convert it into meter and kilometer
➤Write a C program to enter temperature in Celsius and convert it into Fahrenheit
➤Write a C program to enter temperature in Fahrenheit and convert to Celsius
➤Write a C program to convert days into years, weeks and days.
*********************************************
0 Comments