Advertisement
Tahamina_Taha

find large num using Ternary (inplace of conditional oper)

Aug 19th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. //find large number using Ternary Operator( inplace of conditional statement)
  4. {
  5.  
  6.     int a,b,result;
  7.     printf("enter two number :\n");
  8.     scanf("%d%d",&a,&b);
  9.  
  10.     result=(a>b)?a:b;// syntex =(condition) ? value_if_true : value_if_false
  11.     printf("large number: %d",result);
  12.     return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement