Start New Discussion within our Software Development Community

One line stament which acts as a conditional operator ?:
If x=true, returns y else returns z.

#include<stdio.h>
int cond(int x,int y,int z)
{
return (((~(~x+1))&~y&z)|((~x+1)&(y&~z))|(y&z));
}

main()
{
int x,y,z;
scanf("%d %d %d",&x,&y,&z);
printf("%d",cond(x,y,z));
}