First of all, hello I'm new here.
Second, well I'm new to C programming, and I wrote this simple code.
Code:
#include <stdio.h>
int main()
{
int a, b;
printf("enter value one: ");
scanf("%d", &a);
printf("enter a second value: ");
scanf("%d", &b);
if (a < b)
printf("%d is less than %b", a, b);
else
printf("%d is greater than %b", a, b);
return 0;
}
I know it's kind of incomplete, but I just wanted to see if it worked or not.
Ok, the compiler shows no errors or such, but when I run the executable, it goes like this:
enter value one: 3
enter a second value: 5
3 is less than b
As you can see, the second value I declared it as an integer and also used %d, not %c, so why is "3 is less than b" printed instead of 3 is less than 5?
Thanks for your help and time.
-:[XR3D403]:-