#include <stdio.h>
#include <cstdlib>
#include <math.h>
int main ()
{
int option;
char ans;
do
{
system("CLS");
printf("*************************************\n");
printf("(1) Addition\n");
printf("(2) Subtraction\n");
printf("(3) Multiplication\n");
printf("(4) Division\n");
printf("(5) Optional function 1 (sin(x))\n");
printf("(6) Optional function 2 (cos(x))\n");
printf("(7) Optional function 3 (power)\n");
printf("(8) Optional function 4 (square root)\n");
printf("(9) Quit\n");
printf("*************************************\n");
printf("Please Input Your Choice:");
scanf("%d",&option);
system ("cls");
if(option == 1)
{
int I, N;
float number,sum=0;
printf("How many numbers do you want to add:");
scanf("%d",&N);
for (I=1; I<=N; I++)
{
printf("Please enter number %d:", I);
scanf("%f",&number);
sum = sum + number;
}
printf("Total = %.2f\n",sum);
}
else
if(option == 2)
{
int G, J;
float number,subtract,subtract1=0, number1;
printf("How many numbers do you want to Subtract:");
scanf("%d",&J);
{
printf("PLease Enter The Biggest Number To Be SubTract");
scanf("%f",&subtract);
for (G=1; G<=J; G++)
{
J=J-1;
printf("Please enter number %d:", G);
scanf("%f",&number);
subtract1 = subtract - number;
}
printf("Total = %.2f\n",subtract1);
}
}
else
if(option == 3)
{
int F, T;
float number1,sum1=1;
printf("How many numbers do you want mutiplication:");
scanf("%d",&T);
for (F=1; F<=T; F++)
{
printf("Please enter number %d:", F);
scanf("%f",&number1);
sum1 = sum1 * number1;
}
printf("Total = %.2f\n",sum1);
}
else
if(option == 4)
{
int Q, K;
float number,divide, number1,Total=1;
printf("How many numbers do you want to divide:");
scanf("%d",&K);
{
printf("PLease Enter The Biggest Number To Be divide");
scanf("%f",÷);
for (Q=1; Q<=K; Q++)
{
K=K-1;
printf("Please enter number %d:", K);
scanf("%f",&number);
Total = divide - number;
printf("Total = %.2f\n",Total);
}
}
}
printf("Do you want to continue (Y/N)?\n"
"You must type a 'Y' or an 'N'.\n");
scanf("%d",&ans);
oh if the user enter Y , it is suppose to repeat the whole programming if the user enter N it is suppose to end that all but from there do i have to do a if else?