Write a program that prints the largest among three numbers using two if condiion

C Programming Language / Decision Making of C Language

1204

Program:

#include <stdio.h>
int main()
{
	int a, b, c, max;
	printf("\nEnter 3 numbers: \n");
	scanf("%d %d %d", &a, &b, &c);
	max=a;
	if(b>max)
		max=b;
	if(c>max)
		max=c;
	printf("Largest No is %d", max);
	getch();
	return 0;
}

Output:

Enter 3 numbers:
2 3 5
Largest No is 5

Explanation:

None

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.