cs50/src1/compare2.c

26 lines
430 B
C

// Conditionals that aren't mutually exclusive
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// Prompt user for integers
int x = get_int("What's x? ");
int y = get_int("What's y? ");
// Compare integers
if (x < y)
{
printf("x is less than y\n");
}
if (x > y)
{
printf("x is greater than y\n");
}
if (x == y)
{
printf("x is equal to y\n");
}
}