Hi guys!

I'm totaly new in this group and I'm fresh in C as
well.
I have just started C (not C++) and would like to know
what is the simplest and most efficient way of asking
the user if he wants to continue (repeat) program or
simply exit. I have writen (you will laugh) code using
ineficient goto statement.
It seems like goto goes to label end executes only
first encoutered statement. Here is what I came up
with. Thanks for any feedback.

regards
Kinga
-----------------------------------------------------
#include<stdio.h>
main()
{
int c;
program:

printf("Do you want to test this program? (y/n) \n");
c=getchar();
if (c==121)

{
printf("THANKS for testing me!!\n");
goto program;
}


else
printf("GOODBYE \n");
}







           
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now.
http://messenger.yahoo.com


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=621515289


Yahoo! Groups Links

Reply via email to