Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. What will be the output of the following C program ?
       void count (int n){
       static int d=1;

       print f (“%d”, n);
       print f (“%d”, d);
       d++;
       if (n>1) count (n – 1);
       print f (“%d”, d);
    }
      void main( ){
        count(3);
    }
    1. 3 1 2 2 1 3 4 4 4
    2. 3 1 2 1 1 1 2 2 2
    3. 3 1 2 2 1 3 4
    4. 3 1 2 1 1 1 2
Correct Option: A


Output will be 312213444.



Your comments will be displayed only after manual approval.