C program to find the biggest of three numbers

by Nideesh C on April 12, 2011 · 0 comments

in C Programming




/* C program to find the biggest of three numbers */

#include <stdio.h>
#include <conio.h>
#include <math.h>

void main()
{
int  a, b, c;

clrscr();

printf(“Enter the values of a,b and c\n”);
scanf (“%d %d %d”, &a, &b, &c);

printf (“a = %d\tb = %d\tc = %d\n”, a,b,c);

if ( a > b)
{
if ( a > c)
{
printf (“A is the greatest among three\n”);
}
else
{
printf (“C is the greatest among three\n”);
}
}
else if (b > c)
{
printf (“B is the greatest among three\n”);
}
else
printf (“C is the greatest among three\n”);

}

/*—————————–
Output
Enter the values of a,b and c
23 32 45
a = 23  b = 32  c = 45
C is the greatest among three

RUN2
Enter the values of a,b and c
234
678
195
a = 234 b = 678 c = 195
B is the greatest among three

RUN3
Enter the values of a,b and c
30 20 10
a = 30  b = 20  c = 10
A is the greatest among three
——————————*/

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C program to find the area of a triangle, given three sides
  2. Write a C program to find the simple interest , given principle,rate of interest and times
  3. C program to find the area of a circle, given the radius
  4. Sample – Program to enter three integers and output the biggest integer.
  5. Sample – Program to enter three integers and output the biggest integer using IF

Leave a Comment

Previous post:

Next post: