Hello, Im new to this forum. Currently I am beginning to learn C and I have started a little quiz program and need help with one aspect of it
How can i make it so that the program goes back to printf("Welcome to the quiz\n"); when there is an incorrect answerCode:#include<stdio.h> main() { int i; char str[]="You are correct!"; char str2[]="You are incorrect, please start over"; char str3[]="yes"; char str4[]="no"; char str5[5]; printf("Welcome to the quiz\n"); printf("There are 5 questions\nplease type yes or no to the questions\n"); printf("If you get a question wrong, start over!\n"); printf("I am a girl. yes or no?\n");//question 1 gets(str5); i = 0; if (str5 == str4){ printf"Please start over\n");
any other improvements on my code would be nice, im always happy to learn
Thanks!



LinkBack URL
About LinkBacks



