-
printf error
i am playing around with printf.
PHP Code:
#include <stdio.h>
int main()
{
int a, b, c;
printf ("Input 2 integers separated by a comma:\n");
scanf ("%i %i", &a, &b);
c = a + b;
if (a == b)
{
printf ("%i is equal to %i.\n", a, b);
printf ("and their sum is even\n");
}
else if (a < b)
{
printf ("%i is less than %i.\n", a, b);
if (c%2 == 0)
printf ("and their summ is even.\n");
else
printf ("and their sum is odd.\n");
}
else
{
printf ("%i is greater than %i.\n", a, b);
if (c%2 == 0)
printf ("and their sum is even.\n");
else
printf ("and their sum is odd.\n");
}
return 0;
}
the problem is that b is always equal to
-858993460..i dont get it...i checked the format specifiers but they are right
thanks
-
sorry about that..i removed the comma when entering the character, and it worked