I simply want a program that has the user input a value for a and b, and will ask the user to repeat this process if the value a is less than b. Here is my program:
#include <stdio.h>
#include <math.h>
int main(void)
{
int a, b ,c;
while (a<=b)
{
printf("Please enter a value for a:\n");
scanf("%d", &a);
printf("Please enter a value for b:\n");
scanf("%d", &b);
if (a<=b)
printf("a must be greater than b:\n");
}
c=a+b;
printf("The answer of c is: %d\n", c);
return 0;
}
As soon as i run the program, it prints: "The answer of c is: 1829030" (Please note that the last number is always random)
Please help me run this program.