DarkWebCode is a place where you can find a lot of exciting and inspiring stuff about Web Development, Blogging, SEO and many more

Breaking

C program to find biggest among two numbers using ternary operator.

AIM : 
             To write a C program to find the biggest among two numbers using ternary operator.

ALGORITHM :
     
                 1.Start
                 2.Read two numbers.
                 3.Use ternary operator to find biggest number (i.e) (a>b)?a:b;
                 4.Print biggest number.
                 5.Stop.

PROGRAM : 

#include<stdio.h>
#include<conio.h>
void main()
{
           int a,b,c;
           clrscr();
           sum=0;
           printf("Enter the value of a and b: ");
           scanf("%d%d",&a,&b);
           c=a>b?a:b;
           printf("Biggest number = %d",c);
          getch();
}