Write A Program for printing three numbers in ascending order

# include<stdio.h> #include<conio.h> main() { int a, b, c; printf (“enter a, b, c values”); scanf ("%d%d%d”...

# include<stdio.h>
#include<conio.h>
main()
{
int a, b, c;
printf (“enter a, b, c values”);
scanf ("%d%d%d”, & a, & b, & c);
if (a > b && a > c)
{
if (b > c)
printf (“Ascending Order is % d \t %d \t %d”, c, b, a);
else
printf (“Ascending Order is % d \t %d \t %d”, b, c, a);
}
if ( b > a && b > c)
{
if ( a > c )
printf (“Ascending Order is % d \t %d \t %d”, c a, b);
else
printf (“Ascending Order is % d \t %d \t %d”,a, c, b);
}
if ( c > a && c > b)
{
if ( a > b)
printf (“Ascending Order is % d \t %d \t %d”, b, a, c);
else
printf (“Ascending Order is % d \t %d \t %d”, a, b, c);
}
getch();
}

Related

C Programs 4041500980924651263

Post a Comment

emo-but-icon

item