Warning: mysqli_connect(): (HY000/2002): Connection refused in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 38

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 40

Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 41

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 45

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 48

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/programc/public_html/wp-content/plugins/wp-pro-quiz/wp-pro-quiz.php on line 49
C program to add two number | Sum of two numbers - Get Program Code
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

Restrict Mouse Pointer Position C Graphics Program

This C Program will restrict the Mouse Pointer location or to a particular position or x,y ...

Leave a Reply

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

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.