QA – Placement Quizzes | SP Contest 2 | Question 3
What will be the output of the below C program:
int calc( int i) { while (++i > 10); // statement 0 i++; return i; } int main() { int i = 2; printf ( "%d" , calc(i)); return 0; } |
chevron_right
filter_none
Also, if we replace pre-increment operator by post-increment operator in statement 0, then what will be the output of the new program?
(A) 11 and 12
(B) 12 and 11
(C) 4 and 5
(D) 4 and 4
Answer: (D)
Explanation:
Quiz of this Question
Please comment below if you find anything wrong in the above post
Recommended Posts:
- Aptitude | Arithmetic Aptitude 3 | Question 2
- Aptitude | Compound Interest | Question 8
- Aptitude | Algebra | Question 7
- Aptitude | Algebra | Question 8
- Aptitude | Data Interpretation | Question 2
- Aptitude | Data Interpretation | Question 4
- Aptitude | Data Interpretation | Question 5
- Aptitude | Data Interpretation | Question 7
- Aptitude | Data Interpretation | Question 8
- Aptitude | Data Interpretation | Question 9
- Aptitude | Data Interpretation | Question 10
- Aptitude | Assumptions and Conclusions | Question 1
- Aptitude | Syllogism | Question 1
- Aptitude | Probability | Question 5
- Aptitude | Probability | Question 8