Program to Add Two Integers

Write a program to Add Two Integers.

C Program

#include <stdio.h>
int main()
{
    int fisrtNumsecondNum;
    printf("Enter first number : ");
    scanf("%d", &fisrtNum);
    printf("Enter second number : ");
    scanf("%d", &secondNum);
    int sum = fisrtNum + secondNum;
    printf("Sum of two numbers is %d"sum);
    return 0;
}
Input:
Enter first number : 10
Enter second number : 20

Output:

Sum of two numbers is 30


No comments:

Post a Comment