Continue statement is used when user wants to go back again to the start of that loop code, becuase of unexpected input entered by the user, program failure or any other purpose.
//Using continue statement
printf("Enter dividend : ");
scanf("%d", & dividend);
printf("Enter divisor : ");
printf("Cannot divide by zero, pls try again.");
printf("Quotient is : %d ,",quotient);
printf("Remainder is : %d",remainder);
printf("\nDo you want to do another calculation? (y/n)");
Program working steps
Its a simple divido program.
When a user attempts dividend divided by zero, it should not be allowed to proceed further for caluclation. So instead program should print 'cannot divide by zero, pls try again.' and start again from the starting of the loop. This can be implemented using continue statement.
Thats the main reason to use continue statement, rest of the program code is simple and easy to understand.