Find Greatest of 3 numbers
Code :
#include<stdio.h>
int main()
{
int num1, num2, num3;
printf(“Enter three numbers:\n”);
scanf(“%d %d %d”, &num1, &num2, &num3);
if(num1 > num2 && num1 > num3)
{
printf(“Number 1 is greater”);
}
else if(num2 > num1 && num2 > num3)
{
printf(“Number 2 is greater”);
}
else if(num3 > num1 && num3 > num2)
{
printf(“Number 3 is greater”);
}
else
{
printf(“Invalid Enteries !”);
}
return 0;
}
Come again Learn again !
< iCode Buzz />
No comments:
Post a Comment