Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int a, b, max, min;
clrscr();
printf("Enter any Two Values : ");
scanf("%d%d", &a, &b);
max = a>b ? a : b;
min = a<b ? a : b;
printf("Maximum Value is : %d", max);
printf("minimum Value is : %d", min);
getch();
}
Output:
Enter any Two Values : 10 20
Maximum Value is : 20
Minimum Value is : 10
Next Topic : To check whether the given number is even or odd
Previous Topic : Special Operators
No comments:
Post a Comment