Â
In this, we are going to see a program in which we will be finding the greatest among three numbers in C Programming Language.
// WAP to find the greatest of three numbers
#include <stdio.h>
void main()
{
int num1, num2, num3;
printf("Enter the three numbers to find the largest number: ");
scanf("%d %d %d", &num1, &num2, &num3);
if (num1 > num2 && num1 > num3)
{
printf("The number %d is the greatest number", num1);
}
else if (num2 > num1 && num2 > num3)
{
printf("The number %d is the greatest number", num2);
}
else
{
printf("The number %d is the greatest number", num3);
}
}
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP