I made this code:
And I get this output:Code:#include <stdio.h> int main() { char y; do( printf("\nYou can run this program again. Do you want to?" "\nType \"y\" or \"n\" and press enter:"); scanf("%c", &y); }while( y != 'n' ); return 0; }
[quote]
Do you want to run the program again?
Type "y" or "n" and press enter:y
Do you want to run the program again?
Type "y" or "n" and press enter:
Do you want to run the program again?
Type "y" or "n" and press enter:
[quote]
Why is it doing a double print after I type 'y'?
Can someone quickly re-write it, and tell me why it didn't work?
Thanx