AKU Previous Years Question Paper(2022) Solution of programming for problem solving

Q. Which of these, best describes an array

(i) A data structure that shows hierarchical behaviour.

(ü) Container of objects of similar types 

() Container of objects of mixed types 

(iv) All of the above 

[AKU Paper Code 100104 Question No. 1 (A) 2018]

[maxbutton id=”1″ ]

Q. How do you initialize an array in C? 

(1) int arr[3] = (1,2,3); 

(ii) int arr(3) = {1,2,3); 

(iii) int arr[3] = {1,2,3); 

(iv) int arr(3) = (1,2,3);

[AKU Paper Code 100104 Question No. 1 (B) 2018]

[maxbutton id=”1″ ]

Q. What is the output of the following program? 

i) compile-time

ii) run-time

iii) both of the above

(iv) none of the above

[AKU Paper Code 100104 Question No. 1 (C) 2018]

[maxbutton id=”1″ ]

Q. What is the output of the following program?

void main{ int a;

                       a=1;

                     while(a<=1)

                      if(a%2) printf(“%d”, a++);

                      else 

                      printf(“%d”, ++a);

                      printf(“%d”, a+10);

}

(i) 011

(ii) 012

(iii) 111

(iv) 112

[AKU Paper Code 100104 Question No. 1 (D) 2018]

[maxbutton id=”1″ ]

Q. What is the output of following code?

void main()

{

          int i;

          i=0;

          if(i=15,10,5) 

                     printf(“Programming %d”,i);

         else 

                      printf(“Skills %d”,i);

         getch(); 

}

(i) Skills 15

(ii) Programming 5

(iii) Programming 15

(iv) Skills 5 

[AKU Paper Code 100104 Question No. 1 (E) 2018]

[maxbutton id=”1″ ]

Q. What will be printed as the result of the operation below

main()

{

                  char s1[]=”Cisco”

                  char s2[]=”systems”;

                  printf (“%s”, sl);

}

(i) System 

(ii) error

(iii) Cisco

(iv) Compilation fail 

[AKU Paper Code 100104 Question No. 1 (F) 2018]

[maxbutton id=”1″ ]

Q. Process of inserting an element in stack is called 

(i) create

(ü) push

(üi) evaluation

(iv) Pop

[AKU Paper Code 100104 Question No. 1 (G) 2018]

[maxbutton id=”1″ ]

Q. Consider the following segment of C-code:

int j, n;

j=1; while (j<=n) 

   j=j*2;

the number of comparisons made in the execution of the loop for any n>0 is: (Base of log is 2 in all options)

(i) CEIL(log n)

(ii) CEIL(log n) + 2

(iii) FLOOR(log n) + 2

(iv) n

[AKU Paper Code 100104 Question No. 1 (H) 2018]

[maxbutton id=”1″ ]

Q. The minimum number of comparisons required to find the minimum and the maximum of 100 numbers is

(i) 100 

(ü) 200

(iü) 150

(iv) 148

[AKU Paper Code 100104 Question No. 1 (I) 2018]

[maxbutton id=”1″ ]

Q. What is the output of following program

#include <stdio.h> in main() 

{

      int a=1;

      int b=1;

      int c-a || –b;

      int da&& b

print(“a=%d, b=%d, c=%d, d=%d, a, b,c,d

return ();

}

(i) a=0, b=1, c=1, d=0

(ii) a=0, b=0, c=1, d=0

(iii) a=1, b=1, c=1, d=1

(iv) a=0, b=0, c=0, d=0 

[AKU Paper Code 100104 Question No. 1 (J) 2018]

[maxbutton id=”1″ ]

Q. How array and pointers are related? Explain with the help of suitable diagrams.

[AKU Paper Code 100104 Question No. 2 2018]

[maxbutton id=”1″ ]

Q. Write a C program to count the number lines input by the user.

[AKU Paper Code 100104 Question No. 3(A) 2018]

[maxbutton id=”1″ ]

Q. Explain the difference between rull try reference and call by Value with the help of it suitable example.

[AKU Paper Code 100104 Question No. 3(B) 2018]

[maxbutton id=”1″ ]

Q. With the help of an example, differentiate between static and dynamic memory allocations.

[AKU Paper Code 100104 Question No. 4 2018]

[maxbutton id=”1″ ]

Q. What are library functions and their use in C language? Can we wrile our own functions and include them in C library?

[AKU Paper Code 100104 Question No. 5 2018]

[maxbutton id=”1″ ]

Q. Write a recursite C program to print, 

(a) Fibonacci series;

(b) factorial of a given number.

[AKU Paper Code 100104 Question No. 6 2018]

[maxbutton id=”1″ ]

Q. Write the differences between structure and union. Compare them with the help of an example.

[AKU Paper Code 100104 Question No. 7 2018]

[maxbutton id=”1″ ]

Q. Write a C program to convert an infix expression into post expression. In particular, an indir expression : (1-2)* (4+5) will have to postfix expression 12-45+*

[AKU Paper Code 100104 Question No. 8 2018]

[maxbutton id=”1″ ]

Q. Write a C program to illustrate reading of data from a file.

[AKU Paper Code 100104 Question No. 9 2018]

[maxbutton id=”1″ ]

Leave a Comment