Home / Programs / Program to find greatest in 3 numbers.
🚀 Programming Example

Program to find greatest in 3 numbers.

👁 1,286 Views
💻 Practical Program
📘 Step Learning
Program to print a table of any number.

💻 Program Code

/* Program to find greatest in 3 numbers.
  Author: Atnyla Developer */

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
 
	printf("enter value of a, b & c: ");
	scanf("%d%d%d",&a,&b,&c);
	
		if((a>b)&&(a>c))
			printf("a is greatest \n");
		if((b>c)&&(b>a))
			printf("b is greatest \n");
		if((c>a)&&(c>b))
		printf("c is greatest \n");
 
}
                        

🖥 Program Output

enter value of a, b & c: 4  5  6
c is greatest
Press any key to continue . . .
                            

📘 Explanation

Program to print a table of any number.
		if((a>b)&&(a>c))
			printf("a is greatest \n");
		if((b>c)&&(b>a))
			printf("b is greatest \n");
		if((c>a)&&(c>b))
		printf("c is greatest \n");
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.