Multiple choice

What will be the output of following program? #include <cstdlib> #include <iostream> using namespace std; int main() { int k =1; for(int i=1;i<=1;i++) printf(%d,k++); printf(%d,k); system(PAUSE);
return 0;

  1. 22

  2. 11

  3. 12

  4. compile error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Post increment effect only comes in the next statement. so first printf will print1 and in the next printf, only 2 will be printed. So12 will be displayed on screen.Hence, this is the answer.