i kow c up to a good level but i have question for which i am anable to find solution that is to find greatest of 2 numbers in 'c' without using 'if' condition can any one help me out

Recommended Answers

All 3 Replies

Ternary operator perhaps ?

int a = 1;
int b = 2;

int c = ((a > b) ? a : b )

Is there any other way (I mean using bitwise operators) ???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.