What is the output of the following C program?
[gamipress_button type=”submit” label=”Run Code Online” onclick=”window.open(‘https://coderseditor.com’,’_blank’)”]
#include <stdio.h> int main() { int a = 10, b = 20, c = 30; if (c > b > a) { printf("TRUE"); } else { printf("FALSE"); } getchar(); return 0; }
Studently Answered question October 10, 2022
Output: FALSE
Let’s think about the if statement’s condition. Associativity of > is taken into consideration because the expression “c > b > a” contains two greater than (>) operators. > is associative from left to right. As a result, the expression ((c > b) > a) is evaluated, which is false.
Studently Answered question October 10, 2022