Even if the problem is with your IDE not passing the input to your program, the observed behavior is because of a and b being uninitialized when you call printf, to avoid that you must verify that scanf succeeded reading the integer. Here I suggest a way of doing that, it might not be the best solution, but it takes care of inavlid input, looping until valid input is recieved.
You have to check for valid input since scanf wont initialize the passed parameters on invalid input, a better way to do that is with the fgets function in combination with strtol that way you can check the validity of the input data
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int a,b,c;
char string[32];
char *endptr;
int valid;
valid = 0;
while (valid == 0)
{
printf("Enter a: ");
if (fgets(string, sizeof string, stdin) == NULL)
return -1;
if (*string == '\n') /* invalid input */
{
printf("Invalid Input\n");
continue;
}
a = strtol(string, &endptr, 10);
if ((*endptr != '\0') && (*endptr != '\n')) /* invalid input */
{
printf("Invalid Input\n");
continue;
}
printf("Enter b: ");
if (fgets(string, sizeof string, stdin) == NULL)
return -1;
if (*string == '\n') /* invalid input */
{
printf("Invalid Input\n");
continue;
}
b = strtol(string, &endptr, 10);
if ((*endptr != '\0') && (*endptr != '\n')) /* invalid input */
{
printf("Invalid Input\n");
continue;
}
valid = 1;
}
c = a * b;
printf("a = %d, b = %d -> a * b = %d\n", a, b, c);
return 0;
}
the uninitialized values will contain garbage, explaining the behavior you are observing.
With your program if you type any invalid string scanf will fail and you will try to print uninitialized values, you should at least check that it matched the correct number of arguments, like this
if (scanf("%d", &value) != 1)
something is wrong and you should either restart the program or, abort it.
scanffunctions, especially when reading integers. It's not even worth debugging before adding that.