Fundamental Ninja
Array time
Control statements
Miscellaneous
100

Who is known as the founder of the C language?

  1. James Gosling
  2. Martin Richard
  3. Brian Kernighan
  4. Dennis Ritchie
100

If you don’t initialize a static array, what would be the elements set to?

1. 0 

2. an undetermined value 

3. a floating-point number 

4. the character constant '\0'

100

Which data type cannot be checked in the switch-case statement?

  1. enum
  2. character
  3. integer
  4. float
100

Which header file is used for supporting the functions-malloc() and calloc()?

  1. stdio.h
  2. math.h
  3. stdlib.h
  4. memory.h
200

Which of the following is true about C Programming?

  1. Platform Independent
  2. High-level language
  3. Machine Independent
  4. Assembly language
200

Which keyword is used to transfer control from a function back to the calling function?

  1. return
  2. go back
  3. switch
  4. goto
200

Which of the following statement is used to take control to the beginning of the loop?

1. exit

2. break

3. continue 

4. None of the above

200

Which of the function is more appropriate for reading a multi-word string?

  1. puts()
  2. gets()
  3. printf()
  4. scanf()
300

Which operator can be used for accessing the value stored at the address of a pointer variable?

  1. #
  2. *
  3. &&
  4. @
300

In the below statement, what does the "arr" indicates?                                                                                  char *arr[20]; 

  1. arr is an array of 20 characters
  2. arr is an array of 20 character pointers
  3. arr is an array of function
  4. arr is a pointer to an array
300

Which of the following statements are correct about if-else statements in a C-program?

1:Every if-else statement can be replaced by an equivalent statement using ?  operators

2:Nested if-else statements are allowed.

3:Multiple statements in an if block is allowed.

4:Multiple statements in an else block are allowed.

1.1 and 2

2.2 and 3

3.1, 2 and 4

4.2, 3, 4

300

Which of the following statements are correct about string?

  1. The format specifier %s is used to print a string.
  2. The length of the string can be obtained by strlen().
  3. The pointer cannot work on a string.
  4. A string is a collection of characters terminated by '\0'.
  1. 1, 4
  2. 1, 2, 3
  3. 1, 2, 4
  4. 2, 3, 4
400

Which format specifier is used for printing double values?


  1. %u
  2. %df
  3. %lf
  4. None of the above


400


What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of the array?

1. The element will be set to 0. B.

2. The compiler would report an error. 

3. The program may crash if some important data gets overwritten.

4. The array size would appropriately grow.

400


Which of the following sentences are correct about a for loop in a C program?

1:for loop works faster than a while loop.

2:All things that can be done using a for loop can also be done using a while loop.

3:for(;;); implements an infinite loop.

4:for loop can be used if we want statements in a loop to get executed at least once.


A.1

B.1, 2

C.2, 3

D.2, 3, 4

400

How will we free the allocated memory in a C program?

  1. delete(var-name)
  2. dalloc(var-name)
  3. remove(var-name)
  4. free(var-name)
500

 Single line comment in C language begins with _______



  1. :
  2. //
  3. */
  4. /*
500

What is passed when we pass an array as a function argument?

  1. The base address of an array
  2. Address of the last element of the array
  3. The first value of elements in the array
  4. All values of elements in the array
500


Which of the following sentences are correct about a switch loop in a C program?

1:switch is useful when we wish to check the value of a variable against a particular set of values.

2:switch is useful when we wish to check whether a value falls in different ranges.

3:Compiler implements a jump table for cases used in the switch.

4:It is not necessary to use a break in every switch statement.


A.1,2

B.1,3,4

C.2,4

D.2

500

A preprocessor directive is a message from the programmer to the preprocessor.

A.True

B.False

M
e
n
u