GATE CS 2015, set 3 · Question 53 · Programming and Data Structures · Numerical answer (NAT) · 2 marks · no negative marks
Consider the following C program:
#include<stdio.h> int main( ) int i, j, k = 0; j = 2 * 3 / 4 + 2.0 / 5 + 8 / 5; k -= --j; for(i = 0; i < 5; i++) switch(i + k) case 1: case 2: printf(" %d", i+k); case 3: printf(" %d", i+k); default: printf(" %d", i+k); return 0;
The number of times printf statement is executed is ______.
Answer
Answer 10
Answer from the official GATE CS 2015 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes