+ 1
Hey i want to make a program in C to adding two no. Repeadly which ask u want to add more no. After every addition How can i?
Please guide me
3 Answers
+ 7
Give it a shot first and show your code. Others can help you from that point.
0
I mean i want to execute loop again after addition means my code ask every time after addition Do you want to add more no.
0
#include <stdio.h>
int main()
{
int a,b;
char operand;
printf("Please choose the operand (+,-,*,/):");
scanf("%c",&operand);
printf("Enter the value of A and B");
scanf("%d %d",&a,&b);
switch(operand)
{
case '+':
printf("%d+%d=%d",a,b,a+b);
break;
case'-':
printf("%d-%d=%d",a,b,a-b);
break;
case'*':
printf("%d*%d=%d",a,b,a*b);
break;
case'/':
printf("%d/%d=%d",a,b,a/b);
break;
default:
printf("Error");
}
return 0;
}
I mean this that I want to execute this code again after 1 task how can I? Please guide