Home Uncategorized Ternary Operator Demo in C

Ternary Operator Demo in C


Here we written code for to check biggest among the two numbers using Ternary operator.

For improvement of your coding skills we give some tasks along this. If you solve this tasks and send to our email (onlineexamshubteam@gmail.com) with your details. we will display your details(like Name, City, college, photo) in our site.

Task : Write a c program to check given number is even or odd using Ternary operator.

Write a C Program to demonstrate Conditional operator.

int main()
   int a ,b;
   printf(“Enter two numbers : \n”);
   scanf(“%d %d”,&a,&b);
   a>b?printf(“Frist is BIG \n”) : printf(“Second is BIG\n”);
   return 0;

Output :
Enter two numbers :
618 811
Second is BIG

Back to the programs list.

Task Achievers

Till now no one is answered.