Find the greatest of two numbers using Conditional Operator

#include<stdio.h>
void main()
{
int n1,n2,g;
printf("Enter Numbers (n1, n2) : ");
scanf("%d %d",&n1,&n2);
g=n1>n2?n1:n2;
printf("Greatest=%d",g);
}
  

Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C