I get "error: lvalue required as left operand of assignment" for "x=k" in C, but the code runs without an error in C++. I don't understand why C is giving me this error, while C++ doesn't.
#include <stdio.h>
int main() {
int j=10, k=50, x;
j<k ? x=j : x=k;
printf("%d",x);
}