Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Ternary Operator Error

in the ternary operator I wrote z = ( x > y ) ? x : y; for answer but the interpreter gives me error saying use ternary operator on line number 5 :///
by

2 Answers

Nitishw0gpi
Please match your code given below.
#include <stdio.h>
int main() {
int z;
int x=15,y=9;
z = ( x > y ) ? x : y;
printf("%d",z);
return 0;
}


//Also make sure every variables are declared*.
amirmasoud
Unfortunately, It failed again I didn't know how to pass that

Login / Signup to Answer the Question.