Enter the code:
Enter a value of a that is equal to b.
int main(int argc, char *argv[]) {
int a, b;
// Obtain values for a and b
printf("Enter the value for integer a: ");
scanf("%d", &a);
printf("Enter the value for integer b: ");
scanf("%d", &b);
printf("\n\n");
// Compare a and b
if (a > b) // Testing for a greater than b
{
printf("a (%d) is bigger than b 0(%d)\n", a, b);
}
else if (a == b) // Testing for equality
{
printf("a (%d) is equal to b (%d)\n", a, b);
}
else // Otherwise a must be less than b
{
printf("a (%d) is less than b (%d)\n", a, b);
}
system("pause");
return 0;
}
The answer to your question is provided in the image:
Comments
Leave a comment