c ; How to use if-else function
// if - else func
#include <stdio.h>
int main()
{
int x, y;
printf("Enter x and y: \n");
scanf("%d %d", &x, &y);
if (x > y)
{
printf("X is greater than y");
}
else if (x < y)
{
printf("X is lesser than y");
}
else if (x == y)
{
printf("Both are equal.");
}
// or use else
}
Comments
Post a Comment