Home / C / C program to add two number | Sum of two numbers

C program to add two number | Sum of two numbers

C program to add two number | Sum of two numbers 

This is a small program in C to add two number using arithmetic operators.

Also Read :  C program to add two numbers without using arithmetic operators

Code for sum of two numbers

#include<stdio.h>

int main() {
   int a, b, sum;

   printf("\nEnter two no: ");
   scanf("%d %d", &a, &b);

   sum = a + b; // sum of two number is stored in the variable SUM

   printf("Sum : %d", sum);

   return(0);
}

 OUTPUT for C program to add two number

Enter two no: 2 9
Sum : 11

As the program seen it is simple to create and is a program for beginners. Take two different variables in which user will enter the value and then use arithmetic operator to add those values whose result will be stored in the third variable which is the sum of the two number

Incoming search terms:

WAP to print the sum of two numbers with/without arithmetic operator

WAP in c to add two numbers with/without arithmetic operator

Program in c to add two number using arithmetic operator.

Check Also

How to Solve Linear Equation in One Variable In C Programming?

C Program to Solve any Linear Equation in One Variable Find complete C program to ...

Leave a Reply

Your email address will not be published. Required fields are marked *