Programming For Problem Solving

30 Questions | Total Attempts: 735

SettingsSettingsSettings
Programming For Problem Solving - Quiz

MCQ Test


Questions and Answers
  • 1. 
    A function which calls itself is called a ___ function.
    • A. 

      Self Function

    • B. 

      Auto Function

    • C. 

      Recursive Function

    • D. 

      Static Function

  • 2. 
    What is the output of C Program with functions.? void show(); int main() {     show();     printf("ARGENTINA ");     return 0; } void show() {     printf("AFRICA "); }
    • A. 

      ARGENTINA, AFRICA

    • B. 

      AFRICA, ARGENTINA

    • C. 

      ARGENTINA

    • D. 

      Compiler error

  • 3. 
    How many values can a C Function return at a time.?
    • A. 

      Only One Value

    • B. 

      Maximum of two values

    • C. 

      Maximum of three values

    • D. 

      Maximum of 8 values

  • 4. 
    What is the output of C Program with functions.? int show(); void main() {     int a;     printf("PISTA COUNT=");     a=show();     printf("%d", a); } int show() {     return 10; }
    • A. 

      PISTA COUNT=

    • B. 

      PISTA COUNT=0

    • C. 

      PISTA COUNT=10

    • D. 

      Compiler error

  • 5. 
    Every C Program should contain which function.?
    • A. 

      main()

    • B. 

      printf()

    • C. 

      show()

    • D. 

      scanf()

  • 6. 
    What is the minimum number of functions to be present in a C Program.?
    • A. 

      1

    • B. 

      2

    • C. 

      4

    • D. 

      8

  • 7. 
    What is the output of C Program with functions.? static void show(); int main() {     printf("GROW ");     show();     return 0; } static void show() {     printf("MORE"); }
    • A. 

      GROW

    • B. 

      GROW MORE

    • C. 

      MORE GROW

    • D. 

      Compiler error

  • 8. 
    What is the maximum number of statements that can present in a C function.?
    • A. 

      16

    • B. 

      128

    • C. 

      256

    • D. 

      None

  • 9. 
    Arguments received by a function in C language are called ___ arguments.
    • A. 

      Definite arguments

    • B. 

      Formal arguments

    • C. 

      Actual arguments

    • D. 

      Ideal arguments

  • 10. 
    What is the default return value of a C function if not specified explicitly.?
    • A. 

      -1

    • B. 

      0

    • C. 

      1

    • D. 

      None

  • 11. 
    What is the output of C Program with pointers.? int main() {     int a = 4;     int *p;     p=&a;     while(*p > 0)     {         printf("%d ", *p);         (*p)--;     }     return 0; }
    • A. 

      0, 0, 0, 0

    • B. 

      4, 4, 4, 4

    • C. 

      4 3 2 1

    • D. 

      Compiler error

  • 12. 
    What is the output of C Program with functions.? int main() {     int a=20;     printf("INDIA ");     return 1;     printf("CORONA");     return 1; }
    • A. 

      INDIA CORONA

    • B. 

      INDIA

    • C. 

      CORONA

    • D. 

      Compile Error

  • 13. 
    What is the C keyword that must be used to achieve expected result using Recursion.?
    • A. 

      printf

    • B. 

      scanf

    • C. 

      void

    • D. 

      return

  • 14. 
    Choose a correct statement about Recursive Function in C language.
    • A. 

      Each recursion creates new variables at different memory locations

    • B. 

      There is no limit on the number of Recursive calls

    • C. 

      Pointers can also be used with Recursion but with difficulty.

    • D. 

      All of these

  • 15. 
    What are the Types of Arrays.?
    • A. 

      int, long, float, double

    • B. 

      struct, enum

    • C. 

      char

    • D. 

      All of these

  • 16. 
    What is the output of C program.? int main() {     int a[3] = {10,12,14};     int i=0;     while(i<3)     {         printf("%d ", i[a]);         i++;     } }
    • A. 

      14 12 10

    • B. 

      10 10 10

    • C. 

      10 12 14

    • D. 

      None of these

  • 17. 
    What is an array Base Address in C language.?
    • A. 

      Base address is the address of 0th index element.

    • B. 

      An array b[] base address is &b[0]

    • C. 

      An array b[] base address can be printed with printf("%d", b);

    • D. 

      All of these

  • 18. 
    An entire array is always passed by ___ to a called function.
    • A. 

      Call by value

    • B. 

      Call by reference

    • C. 

      Address relocation

    • D. 

      Address restructure

  • 19. 
    What is the need for C arrays.?
    • A. 

      You need not create so many separate variables and get confused while using.

    • B. 

      Using a single Array variable, you can access all elements of the array easily.

    • C. 

      Code maintainability is easy for programmers and maintainers.

    • D. 

      All of these

  • 20. 
    What is a multidimensional array in C Language.?
    • A. 

      It is like a matrix or table with rows and columns

    • B. 

      It is an array of arrays

    • C. 

      To access 3rd tow 2nd element use ary[2][1] as the index starts from 0 row or column

    • D. 

      All of these

  • 21. 
    If an integer array pointer is incremented, how many bytes will be skipped to reach next element location.?
    • A. 

      1

    • B. 

      3

    • C. 

      2

    • D. 

      None

  • 22. 
    What is the dimension of the C array int ary[10][5].?
    • A. 

      1

    • B. 

      2

    • C. 

      4

    • D. 

      8

  • 23. 
    What is the output of C Program with arrays.? int main() {     static int ary[] = {1, 3, 5};     printf("%d %d", ary[-1], ary[5]);     return 0; }
    • A. 

      0, 0

    • B. 

      -1, -1

    • C. 

      Compiler error

    • D. 

      None

  • 24. 
    Array of Arrays is also called.?
    • A. 

      Multi Data Array

    • B. 

      Multi Dimensional Array

    • C. 

      Multi Size Array

    • D. 

      Multi Byte Array

  • 25. 
    What is an Array in C language.?
    • A. 

      A group of elements of same data type.

    • B. 

      An array contains more than one element

    • C. 

      Array elements are stored in memory in continuous or contiguous locations.

    • D. 

      All of these

Back to Top Back to top