scanf is working fine in your code. there is a problem with your 'gcd' function.
if I put printf after scanf in main like this:
Code:
#include <stdio.h>
// more code
int main(){
int i =0 ,j = 0;
puts("Enter the numerator and denomonator");
scanf("%d %d", &i, &j);
printf("You entered: %d %d\n", i, j);
int k = gcd(i,j);
printf("The GCD of the numbers inputted are %d \n", k);
return 0;
}
If I enter 1 and 2, I get:
Code:
Enter the numerator and denomonator
1
2
You entered: 1 2
Look through your gcd function