Monday 20 October 2014

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

Program:

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


Input/Output:

Enter two Numbers: 10
20

Highest Number is 20




0 comments:

Post a Comment