IM HAVING PROBLEM WITH THIS PROGRAM, GOING BACK TO THE MAIN PAGE AND SELECTED PAGE,
IF THE USER ANSWER NO, THE PROGRAM WILL GO BACK TO MAIN MENU
IF THE USER ANSWER YES, THE PROGRAM WILL COMPUTE THE SAME PROBLEM.
help PLS...
THE PROGRAM BELOW WONT GO BACK TO COMPUTE THE SELECTED PAGE IF YOU ANSWER "YES".
#include <stdio.h>
#include <conio.h>
main()
{
float choice,A,CUBE;
char temp;
{
clrscr();
textcolor(BLUE);
gotoxy (24,5);
cprintf("SOLVE FOR THE FOLLOWING VOLUMES\n");
textcolor(345);
gotoxy (26,7);
cprintf("[1] - CUBE");
gotoxy (26,8);
cprintf("[2] - CONE");
gotoxy (26,9);
cprintf("[3] - SPHERE");
gotoxy (26,10);
cprintf("[4] - CYLINDER");
gotoxy (26,11);
cprintf("[5] - EXIT");
textcolor(RED);
gotoxy (24,14);
cprintf("Enter your choice: ");
scanf("%f",&choice);
switch(choice)
{
case 1:
{
clrscr();
textcolor (BLUE);
gotoxy (30,5);
cprintf("Volume of CUBE");
textcolor (345);
gotoxy (24,7);
cprintf("Enter the side of the cube: ");
scanf("%f",&A);
CUBE= (A*A*A);
scanf("%2.0f,&CUBE");
textcolor (345);
gotoxy (24,10);
cprintf("The Volume of the CUBE is %2.0f", CUBE);
{
while (temp != 'n' && temp != 'N' && temp != 'y' && temp != 'Y')
{
textcolor (RED);
gotoxy(24,14);
cprintf("Would you like to compute again(Y/N)? ");
scanf("%c", &temp);
}
if (temp == 'y' || temp == 'Y')
return ;
else
return main();
break;
}
}
}
}
getche();
}