PGDCA Second Semester Exam 2019 13/09/2019

50 Questions | Total Attempts: 96

SettingsSettingsSettings
Please wait...
PGDCA Second Semester Exam 2019 13/09/2019

.


Questions and Answers
  • 1. 
    Identify the loop construct:
    • A. 

      If-else

    • B. 

      Goto

    • C. 

      While

    • D. 

      Switch-case

  • 2. 
    Which of the following is not a storage class
    • A. 

      External

    • B. 

      Automatic

    • C. 

      Register

    • D. 

      Define

  • 3. 
    Which of the following is a correct way of defining a symbolic constant pie in C
    • A. 

      # define pie = 22/7

    • B. 

      #define pie 22/7

    • C. 

      #define pie= 3.142

    • D. 

      # Define pie 22/7

  • 4. 
    The minimum number of times the for loop is executed is
    • A. 

      0

    • B. 

      Cannot be predicted

    • C. 

      1

    • D. 

      2

  • 5. 
    In switch statement
    • A. 

      More than one default allowesd

    • B. 

      Default case, if used, should be the last case

    • C. 

      Default case, if used, can be placed anywhere

    • D. 

      Default case must be present

  • 6. 
    How many while statements are possible in do.... While loop?
    • A. 

      2

    • B. 

      3

    • C. 

      Any number

    • D. 

      1

  • 7. 
    The storage area for register variables
    • A. 

      Cache

    • B. 

      Memory

    • C. 

      Processor registers

    • D. 

      Virtual memory

  • 8. 
    Which of the following statements is false
    • A. 

      The initialization and increment parts of a for statement can be empty

    • B. 

      The body of do-while statement can be empty

    • C. 

      The expression in the condition part of a for statement can be empty

    • D. 

      The initialization part of a for statement cannot have more than one initialization

  • 9. 
    Consider the segment If(1) printf(“yes”); else printf(“no”); what will be the output
    • A. 

      No

    • B. 

      Unpredictable

    • C. 

      Yes

    • D. 

      Error

  • 10. 
    The global variable can be declared
    • A. 

      After main

    • B. 

      After block

    • C. 

      Before main

    • D. 

      Within block

  • 11. 
    Which of the following is not correct
    • A. 

      While loop is executed atleast once

    • B. 

      Do . while loop is executed at least once

    • C. 

      While loop is executed only if the condition is true

    • D. 

      Dowhile loop is ececuted only if the condition is true

  • 12. 
    printf (“\ “ well done\” ”); what will be the output of this statement
    • A. 

      \“well done \”

    • B. 

      Well done

    • C. 

      “ well done”

    • D. 

      \ well done \

  • 13. 
    What is the output of the following program main() {static int y; printf (“%d\n”, y); }
    • A. 

      0

    • B. 

      Run-time error

    • C. 

      Undefined

    • D. 

      Compilation error

  • 14. 
    The number of elements in array declaration
    • A. 

      Dynamically identifies based on largest index used in program

    • B. 

      Does not require to be specified

    • C. 

      Assume default size as ‘0’

    • D. 

      Requires to be specified

  • 15. 
    In C every variable has
    • A. 

      A type and size

    • B. 

      A type, name, value and size

    • C. 

      A name and type

    • D. 

      A size and value

  • 16. 
    All the elements in the array must be
    • A. 

      Defined

    • B. 

      Neither initialized nor defined

    • C. 

      Initialized and defined

    • D. 

      Initialized

  • 17. 
    How many bytes will be allotted for the declaration int num[4] [3]
    • A. 

      6 bytes

    • B. 

      24 bytes

    • C. 

      12 bytes

    • D. 

      48 bytes

  • 18. 
    The total memory required for an array
    • A. 

      Sizeof (datatype) * 2

    • B. 

      Size of (datatype) * size of used array elements

    • C. 

      Sizeof (datatype) * sizeof array

    • D. 

      Size of (array) * datatype

  • 19. 
    The statements that prints out the character set from A-Z is, where a is an integer variable
    • A. 

      For(a=‘A’; a

    • B. 

      For(a=‘A’; a

    • C. 

      For(a=‘a’; a

    • D. 

      For(a=’A’ a

  • 20. 
    The amount of storage required for holding elements of the array depends on
    • A. 

      Data type

    • B. 

      Datatype and size

    • C. 

      Run-time requirement

    • D. 

      Size

  • 21. 
    Array subscripts in ‘C’ always start at
    • A. 

      0

    • B. 

      Compiler dependent

    • C. 

      1

    • D. 

      -1

  • 22. 
    The maximum number of dimension an array can have in C language is
    • A. 

      4

    • B. 

      5

    • C. 

      Compiler dependent

    • D. 

      3

  • 23. 
    What is the result of the expression ( 10/3 )*3+5%3 ?
    • A. 

      10

    • B. 

      11

    • C. 

      8

    • D. 

      1

  • 24. 
    Output of the below program #include<stdio.h> main() {int a,b=0; int c[10]={1,2,3,4,5,6,7,8,9,0 }; for(a=0;a<10;++a) b+=c[a]; printf(“%d”,b); }
    • A. 

      1 3 6 10 15 21 28 32 45 45

    • B. 

      55

    • C. 

      45

    • D. 

      0

  • 25. 
    consider the array definition int num [10] = { 3 ,3 ,3 }; pick the correct answers
    • A. 

      This is syntactically wrong

    • B. 

      The value of num[8] is 3

    • C. 

      This is invalid if it comes within a function

    • D. 

      The value of num[2] is 3

Back to Top Back to top