#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,big;
clrscr();
printf("\n Enter two numbers");
scanf("%d %d ",&a,&b);
big=(a>b)?a:b;
printf("\n Greater number = %d",big);
getch();
}
NOTE:= The conditional operators (?,:) are also called "Ternary Operators" because
they operate on three expression. The general form of conditional operator is
expr1 ? expr2 : expr3.
#include<conio.h>
void main()
{
int a,b,big;
clrscr();
printf("\n Enter two numbers");
scanf("%d %d ",&a,&b);
big=(a>b)?a:b;
printf("\n Greater number = %d",big);
getch();
}
NOTE:= The conditional operators (?,:) are also called "Ternary Operators" because
they operate on three expression. The general form of conditional operator is
expr1 ? expr2 : expr3.
No comments:
Post a Comment