Mar3ie
2013-03-15 11:48:58 UTC
After the calculations have been made and the results displayed, I want the program to ask the user "Do you want to perform any other calculations?". And then use the if, else to instruct the program to restart itself (meaning re-run from the beginning) if the user types "yes", and (return 0) if the user types "no". Here is what I have done so far:
#include
int main()
{
int num1, num2;
char answer;
printf("Enter two integers: ");
scanf("%d",&num1);
scanf("%d",&num2);
printf("The sum is=%d",num1+num2);
printf("\nThe product is=%d",num1*num2);
printf("\nThe difference is=%d",num1-num2);
printf("\nThe quotient is=%d",num1/num2);
printf("\nThe remainder is=%d",num1%num2);
printf("\nDo you want to perform other calculations?");
scanf("%c",&answer);
}