C program for Conditional Operators (Ternary Operators):
#include<stdio.h>
#include<conio.h>
main()
{
int a=10, b=20, small;
clrscr();
small=(a<b)?a:b;
printf("The small value = %d", small);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a=10, b=20, small;
clrscr();
small=(a<b)?a:b;
printf("The small value = %d", small);
getch();
}
No comments:
Post a Comment