So basically I was creating a program to ask the user how many times they wanted to test the program.But I couldnt figure out the problem with my for loop. So:
- If the user wants to test the program 3 times, it should ask for the value of a 3 times only and it should quit after.
This is my code as follows:
#include <stdio.h>
int main()
{
int test;
printf("How many times do you want to test the program?");
scanf("%d", &test);
test = 0; // Reinitializing the test from 0
for (test=0; test=>1; test++) //I cant figure out whats going on with the for loop.
{
printf("Enter the value of a: \n");
scanf("%d", &test);
;
}
return 0;
}
The output should be: "How many times do you want to test the program": 3 Enter the value of a : any numerical value Enter the value of a: any numerical value Enter the value of a: any numerical value (exit)