
C Program to find sum of 2 numbers
Algorithm
Input: Input two numbers
output: Sum of the numbers input
- Start
- Input two numbers
- Sum = a+b
- Print Sum
- Stop
C Program
#include <stdio.h>
int main( )
{
int a, b, sum;
printf("Enter first number: ");
scanf("%d", &a);
printf("Enter second number: ");
scanf("%d", &b);
sum = a + b;
printf("The sum of %d and %d is %d", a, b, sum);
return 0;
}
Note: This Program was created using visual studio code. The Program file can be downloaded by clicking here
Comments