C program to Find Maximum between two Numbers Using Conditional Operators ?
Q:- Write a C Program to Find Maximum Between Two Numbers Using Conditional
Operators ?
Operators ?
Input
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int num1,num2,max;
clrscr();
printf("Enter Two numbers =");
scanf("%d%d",&num1,&num2);
scanf("%d%d",&num1,&num2);
max = (num1>num2) ? num1 : num2;
printf("Maximum b/w %d and %d=%d",num1,num2,max);
getch();
}
Output
Enter Two Numbers =
10
20
Maximum b/w 10 and 20 = 20
10
20
Maximum b/w 10 and 20 = 20
Comments
Post a Comment