You are on page 1of 4

Objective questions(units-1&2&3)

1. Which of the following operator has lowest precedence?


a)++(post increment)b)&&(logical AND) c) & (bit-wise AND) d) ,(comma)

2. what is the function used for reading input to the program from standard input?
a) print() b)printf() c) scan() d) scanf()

3. ASCII stands for


a) American Standard Code for Information Interchange
b)Asian Standard Code for Information Interchange
c) American Standard Code for Interchange Information
d)Asian Standard Code for Interchange Information

4. Identify the keyword(s) for floating-point Datatypes.


a) float b) double c) int d) Both a & b

5. Syntax of accesing seventh element in an array


a) a{7} b)a[7] c)a[6] d)a’7’

6. strcat() function adds null character.


a) Only if there is space b) Always
c) Depends on the standardd) Depends on the compiler

7. What will be the value of var for the following C statement?


var = strcmp("Hello", "World");
a)-1 b)0 c)1 d) strcmp has void return-type

8. Arguments received by a function in C language are called ___ arguments.


a) Definite arguments
b) Formal arguments
c) Actual arguments
d) Ideal arguments

9. C language contains 31_______ number of keywords


.
10.
11. If an array is declared as int A[5][5], then array A contains ___25______ number of
elements.

12. The elements of an array are always stored in _____Contigous_____memory locations.

13.
14. In functions, parameters can be passed through ________calling_____ and called function
techniques.

15) 3) Choose a syntax for C Ternary Operator from the list.


A) condition ? expression1 : expression2
B) condition : expression1 ? expression2
C) condition ? expression1 < expression2
D) condition < expression1 ? expression2
16) 2. The format identifier '%d' is also used for _____ data type?

A. char B. int C. float D. double

17) 5. What is the size of an double data type?

A. 4 Bytes B. 8 Bytes C. 1byte

D. 2 bytes

18)how many dimensions have multi-dimensional array---3------------

19)If two strings are same,then strcmp() it will return - --0--------------

20)string concatenation means---------combining two srtings-----------

21) 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 the above.

22) An array Index starts with.?


A) -1
B) 0
C) 1
D) 2

23) Which of the following is the correct way to declare a multidimensional array in Java?
A. int arr[[]];
B. int[] arr;
C. int[][]arr;
D. int[[]] arr;
24) Size of the array need not be specified, when
A. It is a formal parameter
B. It is a declaratrion
C. Initialization is a part of definition
D. All of these
25) When does the ArrayIndexOutOfBoundsException occur?
A. Run-time
B. Not an error
C. Compile-time
D. Not an exception at all
26)  Array is an example of _______ type memory allocation.
A. Compile time
B. Run time
C. Both A and B
D. None of the above
27)  Which of the following function is more appropriate for reading in a multi-word string?
A. scanf()
B. printf()
C. gets()
D. puts()
28) What are the advantages of arrays?
A. Easier to store elements of same data type
B. Index of first element of an array is 1
C. Elements in an array cannot be sorted
D. Objects of mixed data types can be store
29) What are the disadvantages of arrays?
A. Index value of an array can be negative
B. Elements are sequentially accessed
C. Data structure like queue or stack cannot be implemented
D. There are chances of wastage of memory space if elements inserted in an array are lesser
than the allocated size
30)  Elements in an array are accessed _____________
A. randomly
B. sequentially
C. exponentially
D. logarithmically

31) What is a String in C Language.?


A) String is a new Data Type in C
B) String is an array of Characters with null character as the last element of array.
C) String is an array of Characters with null character as the first element of array
D) String is an array of Integers with 0 as the last element of array.
32)What is the Format specifier used to print a String or
Character array in C Printf or Scanf function.?
A) %c
B) %C
C) %s
D) %w
33) Choose correct statement about Functions in C Language.
a) A Function is a group of c statements which can be reused any number of times
b) Every Function has a return type
c) Every Function may no may not return a value
d) All the above

34)  A function which calls itself is called a ___ function.


a) Self Function
b) Auto Function
c) Recursive Function
d) Static Function

35)  The keyword used to transfer control from a function back to the calling function a)
switch
b) goto
c) go back
d) return

36) What are the types of functions in C Language?


a) Library Functions
b) User Defined Functions
c) Both Library and User Defined
d) None of the above
37) Choose correct statements about C Language Pass By Value.
a) Pass By Value copies the variable value in one more memory location
b) Pass By Value does not use Pointers
c) Pass By Value protects your source or original variables from changes in outside functions or
called functions
d) All the above

38) What is the limit for number of functions in a C Program?


a) 16
b) 31
c) 32
d) No Limit

39) What is the minimum number of functions to be present in a C Program?


a) 1
b) 2
c) 3
d) 4

40) Arguments passed to a function in C language are called ___ arguments.

a) Formal arguments
b) Actual Arguments
c) Definite Arguments
d) Ideal Arguments

You might also like