I'm a biginner, I made program that chose wanna continue or exit, but I don't konw how to make the program close when I chose "no"/"n"
here is my code :
char answer;
do
{
do
{
printf("\nHi %s, \nDO you want to count your Index Prestasi Semester(IPS) ?(y/n)",name);
scanf("%s",&answer);
fflush(stdin);
}
while(answer != 'y' && answer !='n');
//exit function
}
while(answer == 'n');
Hello,
I am not able to answer your question but please place your code in between this
[ code]
[ /code]
and it will look like this
1 2 3 4 5 6 7 8 9 10 11 12 13
char answer;
do
{
do
{
printf("\nHi %s, \nDO you want to count your Index Prestasi Semester(IPS) ?(y/n)",name);
scanf("%s",&answer);
fflush(stdin);
}
while(answer != 'y' && answer !='n');
//exit function
}
while(answer == 'n');