Saturday 29 August 2015

Write a c program to find largest among three numbers using conditional operator



Write a c program to find largest among three numbers using conditional operator


#include<stdio.h>
int main(){
  int a,b,c,big;
  printf("\nEnter 3 numbers:");
  scanf("%d %d %d",&a,&b,&c);

  big=(a>b&&a>c?a:b>c?b:c);
  printf("\nThe biggest number is: %d",big);

  return 0;
}

One Response so far.

  1. Geminair says:

    Keep sharing such an informative blog like this.
    Air Conditioning Sydney

Leave a Reply

 
 

Labels

Blog Archive