after the first post I resulted to goto but i know its a bad habit so I need to change it!! here is my program with goto
Code:
next:
do{
printf("Magnum opus means great work. yes or no?\n");//question 1
gets(str5);
} while (strcmp (str3, str5) != 0);//correct answer is yes
puts ("Correct answer!");
printf("A paragon is a self contradictory statement. yes or no?\n");//question 2
gets(str5);
if (strcmp (str4, str5) != 0){ //correct answer is no
printf("%s\n", str2);
c = getc(stdin);
goto next;
}
else{
printf("A dystopia is a perfect world. yes or no?\n");
}
gets(str5);
if (strcmp (str4, str5) != 0){ //correct answer is no
printf("%s\n", str2);
c = getc(stdin);
goto next;
}