Am learning really hard on this program, but am stuck. This code works fine for only one random equation, but now I need to get the user to ask the number of questions they need which will be given in number form, i.e question 1,2,3 and so on. I can't get that to work, also when they answer the question the score should be given at the end that is number correct. Any help will be appreciated. Thanks.
Code:
//included libraries
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define  MAX_VAL 10

int main() {
//Variables declaration. This defines both the problem, random numbers and answer functions
int problem = 0, num1, num2, op, total;
float answer, answer2 = 0;


//This function seeds the random function with the computer's internal clock
srand(time(0));

//To get random operator and random numbers -50 to 50 inclusive.
op = rand()%4;
problem =1 + rand ()%MAX_VAL;
num1 = (rand()%101)-50;
num2 = (rand()%101)-50;
total = rand()%10;


//Prints the welcome statement.
printf("Welcome! How many problems would you like?.\n\n");
scanf("%d", &problem);
printf("Here is random problem number:%\n", total);

//This part of the code generates the operation

while (op == problem){
answer = num1 + num2;
printf("%d + %d= ?\n", num1, num2);
printf("\nAnswer:");
scanf("%f", &answer2);
}  if (op == 1) {
answer = num1 - num2;
printf("%d - %d= ?\n", num1, num2);
printf("\nAnswer:");
scanf("%f", &answer2);
}  if (op == 2) {
answer = num1 * num2;
printf("%d * %d= ?\n", num1, num2);
printf("\nAnswer:");
scanf("%f", &answer2);
}  if (op == 3) {
answer = num1 / num2;
printf("%d / %d= ?\n", num1, num2);
printf("\nAnswer:");
scanf("%f", &answer2);


}





printf("\nCongratulations! You have answered the problem correctly!\n");


return 0;
}