#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,m,n;
printf("\n enter 4 numbers");
scanf("%d%d%d%d",&a,&b,&c,&d);
(m=(a<b?a:b))<(n=(c<d?c:d))?printf("minimum number is=%d",m):printf("minimum number=%d",n);
}
if u want explanation of this code then see solution pic of this question..if u have any doubt and then then plzz write comment ...i hope u like it thanku
#include<conio.h>
void main()
{
int a,b,c,d,m,n;
printf("\n enter 4 numbers");
scanf("%d%d%d%d",&a,&b,&c,&d);
(m=(a<b?a:b))<(n=(c<d?c:d))?printf("minimum number is=%d",m):printf("minimum number=%d",n);
}
if u want explanation of this code then see solution pic of this question..if u have any doubt and then then plzz write comment ...i hope u like it thanku
Ternair operator is difficult to understand.
ReplyDeleteBut you can use it with all language : http://www.yvoz.net/?p=141 -> ternary operator in c#
thanks bro
Delete