i am playing around with printf.
the problem is that b is always equal toPHP 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;
}
-858993460..i dont get it...i checked the format specifiers but they are right
thanks




Reply With Quote