? GTU Engineering 1st Year MCQ | Computer Programming and Utilization-2110003 Summer 2016 Sem-2

MCQ(s) of Computer Programming and Utilization (2110003) - Summer 2016 Sem-2

    • Q. 1  Which of the following is ternary operator?
    • (A) ??
      (B) :?
    • (C) ?:
      (D) ::
    • (C) ?:
    • Q. 2  Which header file is essential for using scanf() function?
    • (A) ctype.h
      (B) string.h
    • (C) conio.h
      (D) stdio.h
    • (D) stdio.h
    • Q. 3  A declaration float sum, value; occupies _____ of memory?
    • (A) 2 byte
      (B) 4 byte
    • (C) 6 byte
      (D) 8 byte
    • (D) 8 byte
    • Q. 4  Array index start at
    • (A) 1
      (B) User Defined
    • (C) 0
      (D) None of above
    • (C) 0
    • Q. 5  When function calls itself, it is known as ______.
    • (A) Recursion
      (B) exit control loop
    • (C) Nested loop
      (D) user defined function
    • (A) Recursion
    • Q. 6  Default value of global variable is
    • (A) 0
      (B) 1
    • (C) Garbage value
      (D) Depend on data type
    • (A) 0
    • Q. 7  When fopen() fails to open a file it returns
    • (A) NULL
      (B) 1
    • (C) -1
      (D) None of above
    • (A) NULL
    • Q. 8  Default value of local variable is
    • (A) 0
      (B) 1
    • (C) Garbage value
      (D) Depend on data type
    • (C) Garbage value
    • Q. 9  ASCII value of ‘A’ is _____.
    • (A) 55
      (B) 65
    • (C) 75
      (D) 85
    • (B) 65
    • Q. 10  MACRO is used to _______________.
    • (A) Save memory
      (B) fast execution
    • (C) Both a & b
      (D) none of above
    • (B) fast execution
    • Q. 11  Every string is terminated by NULL character. How it is represented?
    • (A) ‘\0’
      (B) NULL
    • (C) Both a & b
      (D) none of above
    • (A) ‘\0’
    • Q. 12  Which are not looping structures?
    • (A) For loop
      (B) While loop
    • (C) Do...while loop
      (D) if…else
    • (D) if…else
    • Q. 13  If ptr is a pointer to int, having value ptr=100. After ptr++, what is the value of ptr?
    • (A) 100
      (B) 101
    • (C) 102
      (D) 103
    • (C) 102
    • Q. 14  How many times the following code prints the string “hello”

      for(i=1;i<=50;i++)

          printf(“Hello”);

    • (A) 1
      (B) 50
    • (C) Zero
      (D) None of them
    • (B) 50