write a program in C to input largest of three number
Answers
Answered by
0
/*
* C program to find the biggest of three numbers
*/
#include <stdio.h>
void main()
{
int num1, num2, num3;
printf("Enter the values of num1, num2 and num3\n");
scanf("%d %d %d", &num1, &num2, &num3);
printf("num1 = %d\tnum2 = %d\tnum3 = %d\n", num1, num2, num3);
if (num1 > num2)
{
if (num1 > num3)
{
printf("num1 is the greatest among three \n");
}
else
{
printf("num3 is the greatest among three \n");
}
}
else if (num2 > num3)
printf("num2 is the greatest among three \n");
else
printf("num3 is the greatest among three \n");
}
Similar questions
Computer Science,
6 months ago
English,
6 months ago
Math,
6 months ago
Math,
1 year ago
English,
1 year ago
India Languages,
1 year ago