Computer Science, asked by XXXTENTAClON, 1 year ago

Write a program in C that adds two numbers repeatedly ?​

Answers

Answered by Anonymous
0

Here is your Code!

#include <stdio.h>

int main()

{

int a, b, c;

char ch;

while (1) {

printf("Input your two integers!\n");

scanf("%d%d", &a, &b);

getchar();

c = a + b;

printf("(%d) + (%d) = (%d)\n", a, b, c);

printf("Write here your number to add it more (y/n)\n");

scanf("%c", &ch);

if (ch == 'y' || ch == 'Y')

continue;

else

break;

}

return 0;

}

____________________________________

See this too

&lt;iframe src="https://code.sololearn.com/WOiLZLZoiGWy/" width="100%" height="100px" frameborder="0"&gt;

Answered by PratikMondal123456
0
Hey mate here is your answer......





Addition of two numbers in C: This C language program performs the basic arithmetic operation of addition of two numbers and then prints their sum on the screen. For example, if a user will input two numbers as; '5', '6' then '11' (5 + 6) will be printed on the screen. In the expression (c = a + b) overflow may occur if the sum of a and b is larger than the maximum value which can be stored in the variable c. Similarly, you can write a C program which performs subtraction, multiplication, and division of two numbers.

Addition program in C

#include<stdio.h>

 

int main()

{

   int a, b, c;

   

   printf("Enter two numbers to add\n");

   scanf("%d%d", &a, &b);

   

   c = a + b;

   

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

   

   return 0;

}


PratikMondal123456: PLEASE MARKME AS BRAINLIEST
Similar questions