1

What is the output of the following code? int main() { double x = 1.2; int sum = (int) x + 1; printf("sum=%d", sum); return 0; }

Correct Answer: 2

Make the most of this question

This page focuses on one Principles of Programming Languages question from Engineering. After checking the answer, return to the topic list to practice more or run a timed set.

Principles of Programming Languages MCQ: What is the output of the following code? int main() { double x = 1.2; int sum = (int) x + 1; printf("sum=%d", sum); return 0; } | Extra Education