CODE BOX
Pages
Home
Data Types
Algorithms
Easy Find
Linux Commands
Monday, 5 October 2015
Using ternary operator (? :) write down an expression to find largest of three numbers.
CODE ::
#include <stdio.h>
int main ()
{
int a=15,b=20,c=10,big;
big = (a>b) ? a : b;
big = (big>c) ? big : c;
printf("%d\n",big);
return 0;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment