❓ Help C Programming ( Press [Y] to continue, [X] to exit...)

Status
Not open for further replies.
int main()
{
char choice; //declaration

printf("Press [Y] to continue, [X] to exit");

switch(choice)
{
case 'Y':
case 'y': (put your function calls or continuation statements here)
break;
case 'X':
case 'x': exit();
break;
default: printf("Invalid Choice");
}
return 0;
}
 
int main()
{
char choice; //declaration

printf("Press [Y] to continue, [X] to exit");

switch(choice)
{
case 'Y':
case 'y': (put your function calls or continuation statements here)
break;
case 'X':
case 'x': exit();
break;
default: printf("Invalid Choice");
}
return 0;
}
try ko to mamaya :D sana mag work ^_^ salamat bossing (y) di ko kasi ma do..while eh.. di din ma if() :dead:
sana ma ok na to :D
 
pwede mo din ilagay sa loob ng do-while loop ang switch statement (y)
ahh sge po.. do-while, for(;;), while(), nested loops, pa lang po kasi tinuro sa amin eh..

may gotoxy pa kami.. baka advance lang to masyado XD eto sakin eh
Code:
  xxx=(80-strlen("Another Entry? [Y] or [N]:  "))/2;
  gotoxy(xxx,20);printf("Another Entry? [Y] or [N]: ");
  gotoxy(1,21);
    for(u=1;u<75;u++)printf("-");
  gotoxy(26,20);gets(tryy[i]);
    ex=toupper(tryy[i][0]);
    ex=atoi(tryy[i][0]);
    if(ex=='X')break;
    if(ex=='Y')continue;

kaso di daw ma convert into "int" ang "char"
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 4K
    Views
  • 2
    Participants
Last reply from:
xSilent

Trending Topics

Online now

Members online
946
Guests online
1,487
Total visitors
2,433

Forum statistics

Threads
2,273,362
Posts
28,948,997
Members
1,235,715
Latest member
mjsimborio2
Back
Top