I have a really quick and simple question. I'm trying to make a calculator and when the user completes his equation the program asks if he wants to keep on going or he wants to exit the program. I tried to do a do-while loop but it doesn't work for some reason. Can someone help me out? Thanks
}
int main() {
char ch;
int A;
do{
printf("Vali millist tehet soovid teha:\n\n");
printf("Liitmine - 1\nLahutamine - 2\nKorrutamine - 3\nJagamine - 4\n");
printf("Arvu ruuduks tegemine (x2) - 5\nArvu ruut valitud eksponendiga (xy) - 6\n");
printf("Arvu ruutjuur - 7\nArvu siinus - 8\nArvu koosinus - 9\nArvu tangens - 10\n\n");
scanf("%d", &A);
if (A == 1) {
liitmine();
}
else if (A == 2){
lahutamine();
}
else if (A == 3){
korrutamine();
}
else if (A == 4){
jagamine();
}
else if (A == 5){
x2();
}
else if (A == 6){
xy();
}
else if (A == 7){
ruutjuur();
}
else if (A == 8){
sin();
}
else if (A == 9){
cos();
}
else if (A == 10){
tan();
}
printf("\nUue tehte sooritamiseks kirjuta Y, väljumiseks kirjuta N.\n");
scanf("%c", &ch);
getch();
}
while(ch == 'y' || ch == 'Y');
}