Output???? #include int main() { int i=43; printf("%d\n",printf("%d",printf("%d",i))); return 0;}

  1. 1243

  2. 4321

  3. 1234

  4. 4312


Correct Option: B

AI Explanation

To determine the output of the given code, let's go through each step:

#include 

int main() {
    int i=43;
    printf("%d\n", printf("%d", printf("%d", i)));
    return 0;
}

The printf function in C returns the number of characters printed. So, let's break down the code step by step:

  1. printf("%d", i) will print 43 and return 2 (the number of characters printed).
  2. printf("%d", printf("%d", i)) will print the result of the previous printf statement, which is 2, and return 1 (the number of characters printed).
  3. printf("%d\n", printf("%d", printf("%d", i))) will print the result of the previous printf statement, which is 1, and return 1 (the number of characters printed).

Therefore, the output of the code will be 4321.

So, the correct answer is B) 4321.

Find more quizzes: