C program for addition of two numbers: To implement a program which performs the addition of two numbers and to print the addition of numbers?
Addition of numbers: we need to take input two numbers and perform addition.

Algorithm for Addition of two numbers

  1. Take two numbers input. No1 and No2
  2. Perform addition. sum= No1+no2
  3. Print Addition. sum

C program for addition of two numbers

#include<stdio.h>
void main()
{
//declare variables
int no1, no2, sum;
//take user input
printf(" \n Enter first number :");
scanf("%d",&no1);
printf ("\n Enter second number :");
scanf ("%d",&no2);
sum = no1 + no2;
printf ("\n Addition of two numbers =%d",sum);
}

Output:

C program for addition of two numbers

Write A Comment