I am trying to make a continue loop for a game, am I on the right track? If not what is wrong with it and what do I need to fix. Thank you.
Code:
#include <stdio.h>
int playagain;
int main(void)
{
printf("Would you like to play again? (y/n)");
scanf("\n%d", playagain);
if ( playagain = 'y') {
printf("Would you like to play again? (y/n)");
scanf("\n%d", playagain);
}
else if ( playagain = 'n') {
printf("Maybe another time");
}
return 0;
}
i can't get it to ask you to play again a second time and when i enter "n" it comes up with "would like to play again" and not "Maybe another time.