Write a C Program to find maximum from two numbers using conditional operator.

Write a C Program to find maximum from two numbers using conditional operator.

Here is the C Program to find maximum from two numbers using conditional operator.

#include<stdio.h>
#include<conio.h>
void main()
{          int a,b;
            clrscr();
            printf(“Enter value of A:”);
            scanf(“%d”,&a);
            printf(“Enter value of B:”);
            scanf(“%d”,&b);
            (a>b)?printf(“%d is maximum”,a): printf(“%d is maximum”,b);
            getch();
}
Output

You may also like...

Leave a Reply