Q:

Addition of two numbers in C

0

Addition of two numbers in C

The addition of two numbers in C language is the arithmetic operation of adding them and printing their sum on the screen. For example, if the input is 5 and 6, the output is 11.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
int main()
{
  int x, y, z;

  printf("Enter two numbers to add\n");
  scanf("%d%d", &x, &y);

  z = x + y;

  printf("Sum of the numbers = %d\n", z);

  return 0;
}

:output

Enter two numbers to add

1

2

Sum of the numbers = 3

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now