Monday, 17 August 2015

To find Largest of Two Numbers using Conditional Operator

#include<stdio.h>
#include<conio.h>
main()
{
      int a,b,max;
      printf("Enter two numbers : ");
      scanf("%d %d",&a,&b);
      max = a > b ? a : b;
      printf("Largest number : %d\n", max);
      getch();
}

No comments:

Post a Comment