Monday, 20 October 2014

Write a program to read three numbers from the user and find the highest number

Program:

#include<stdio.h>
#include<conio.h>
void main( )
{
        int x,y,z,h;
        clrscr( );
        printf("\nEnter Three Numbers:");
        scanf("%d%d%d",&x,&y,&z);
        h=((x>y)&&(x>z))?x:(y>z)?y:z;
        printf("\nHighest Number is %d",h);
        getch( );
}


Input/Output:

Enter Three Numbers:10
20
30

Highest Number is 30




0 comments:

Post a Comment