Sei sulla pagina 1di 6

C- Objectives ( Unit -1)SET-1

1. Which of the following is not a valid variable name declaration?


a) int _a3;
b) int a_3;
c) int 3_a;
d) int _3a
2. All keywords in C are in
a) LowerCase letters b) UpperCase letters

c) CamelCase letters

3. Which of the following is not a valid C variable name?


a) int number;
b) float rate;
c) int variable_count;

d) None

d) int $main;

4. The format identifier %i is also used for _____ data type?


a) char
b) int
c) float
d) double
5. What is the size of an int data type?
a) 4 Bytes
b) 8 Bytes
c) Depends on the system/compiler
6. Which of the following is not a valid variable name declaration?
a) float PI = 3.14;
b) double PI = 3.14;
c) int PI = 3.14;

d) Cannot be determined

d) #define PI 3.14

7. Which is correct with respect to size of the datatypes?


a) char > int > float
b) int > char > float
c) char < int < double

d) double > char > int

8. Which keyword is used to prevent any changes in the variable within a C program?
a) immutable
b) mutable
c) const
d) volatile
9. A variable declared in a function can be used in main
a) True
b) False
c) True if it is declared static
d) None of the mentioned
10. Which escape character can be used to beep from speaker in C?
A) \a
B) \b
C) \m
D) \n
11. Explicit type conversion is known as ....................
A) casting
B) conversion
C) disjunction
D) separation
12. If a is an integer variable, a=7/3; will return a value
A) 2.5
B) 3
C) 0
D) 2
13. Hierarchy(Operator Precedence) decides which operator

A) is most important B) is used first C) is fastest D) Operates on largest


numbers
14. Which of the following is the correct order of evaluation for the below expression?
z=x+y*z/4%2-1
A. * / % + - =

B. = * / % + -

C. / * % - + =

D. * % / - + =

15. In which order do the following gets evaluated


1.Relational
A. 2134

2.Arithmetic
B.1234

3.Logical

C.4321

4. Assignment
D.3214

C- Objectives (SET-2)
1. Which of the following cannot be checked in a switch-case statement?
A. Character

B.Integer

C.

Float

D.

enum

2. Identify the unconditional structure :


1)do-while
2)Switch
3)Identify the wrong statement :
1) if(a>b);

2) if a > b ;

3)goto

4)If

c) if (a>b) { ;}

d)none

4)The minimum number of times d0-while loop executed is :


1)0

2) 1

3)2

4) can not be predicted

5) What is the value of x in the expression x = (a=10 , a*a)


1)invalid

2) 0

3)10

4)100

6)The & operator displays :


a)Address of variable

b)value of variable c)a and b both

d)none

7)what function is appropriate for accepting a string


a)gets()

b)getch()

c)getche()

d)scanf()

8)Which is the correct statement for finding cube of 2.


a)pow(2,3)

b)pow(3,2)

c)pow(c)

d)none

9)In switch , character constants are automatically converted to-------a)floats

b)integers

c)double

10) A single character input from the keyboard can be obtained by using the function.
(A) printf ( )

(B) scanf ( )

(C) putchar ( )

(D) getchar ( )

11)The variable that are declared outside all the functions are called ______.
(A) Local variable

(B) Global variable

(C) Auto variable

(D) None of the above

12)Which can not be used for multiple conditions :


a)Simple-if

b)switch

c) Else if ladder

13)How many times loop will be run : for(i=10; ; i- -)


a)10

b)1

c)9

d)Infinite

14)Which is an exit-controlled loop :


a)for

b)while

c)do

d)none

15)The continue command can not be used with :


a)For

b) switch

c)Do

d)While

d)nested-if

C- Objectives (SET-3)
1)what is the default return type of a function ?
a)void

b)int

c)float

d)char

2)The program execution starts from :


a)function defined first b)main()

c)function defined last d)none

3)c language allows arguments to be passed


a)call by val

b)call by ref

c)both

c)none

4)When main function is called , it is called with the arguments


a)argc

b)argv

c)none

d)both

5)Header file in c contains :


a)compiler commands b)Library functions
d)none

c)Header information

6)Function within another function is known as :a)array of function

b)nested function

c)function prototype

7)which tells compiler about number of parameters function takes, data-types of


parameters and return type of function :
a)function prototype

b)calling function

c)called function

8)A function which is called by another function is known as :


a)nested function

b)calling function

c)called function

9)A function which calls another function is known as :


a)nested function

b)calling function

c)called function

10)A function which calls itself is known as :


a)nested function

b)calling function

c)called function

d)recursive function

11)A process in which a function calls itself is known as :


a)Multifunction

b)recursion

c)indirection

12)An array which has more than one subscript is known as :


a)matrix

b)multidimensional array c)character array

d)prototyping

13) A two dimensional array is also known as :


a)Vector

b)matrix

c)string

14)A matrix which has more zero elements is known as :


a) unit matrix

b)zero matrix

c)sparse matrix

15)Members of an array are accessed using ..


a)values

b)variable

c) index

16) Index of array starts from ..


a) zero

b)one

c) -1

17) If a[9] is an array of integers , how many values can it store ?


a) 9

b) 10

c)11

d)8

18)If table[5][7] is an array , how many values can be stored by this array ?
a)12

b)5

c)7

d)35

19)if marks[4][6] is an array , how many rows will it have ?


a) 4

b)6

c)24

d)10

C- Objectives (SET-4)
Q.1)Arrays are used to store elements of :a)Same type

b) multiple type

c)different type

d)none

Q.2) Which of the following is a derived data type :a) Pointer

b)Function

c)Array

d)All

Q.3)The sizeof operator returns the size of a data type expressed in :


a)bits

b)nibbles

c)words

d)bytes

q.4)Which of the following is not an unformatted console I/O function :


a)gets()

b)puts()

c)printf()

d)getch()

q.5) Which class is used to declare a variable as global in other program :


a)auto

b)register

c)static

d)extern

q.6) In which storage class , the variable is not stored in main memory :
a) a)auto

b)register

c)static

d)extern

q.7) which operator is used for multiple indirection :


a) &

b)**

c).

d)#

q.8)A variable which stores address of another variable is known as :


a)pointer

b)static

c)address of

d)function

q.9)Which operator is used for referencing :a) &

b)*

c).

d)#

q.10)Which operator is used for dereferencing :a) &

b)*

c).

d)#

q.11)Which operator is known as address-of operator :a) &

b)*

c).

d)#

q.12)Which operator is known as value-at -address operator :a) &

b)*

c).

d)#

q.13) Address of first member of array is known as :


a) first address

b)base address

c)array address

q.14) Can a pointer points to itself ?


a) yes

b)No

q.15) A pointer which points to another pointer is known as :


a)multipointer

b)pointer-to-pointer

c)void pointer

q.16)which operation can not be performed between two pointers ;


a) subtraction

b)addition

c)comparison

q.17) A pointer that can point at objects of any data type?


a)Null pointer

b)void pointer

c)data pointer

q.18) A pointer that points to nothing.


a)Null pointer

b)void pointer

c)data pointer

q.19)Arguments given to main function from command prompt are known as :


a) special arguments

b)command line arguments

C- Objectives (SET-5)
1)

Which is a formatted file function ?


a) fgets() b)fputs() c)fscanf()

2)

d)fgetc()

which function is not used for text file ?


a) fwrite()

b)fgets()

c)fscanf() d)fprintf()

3)which function does set the cursor to the starting of a file ?


a)ftell()

b)rewind()

c)fseek()

4) data can be accessed directly from which file ?


a) sequential

b)random

5) A collection of variable of different data types is known as :


a)array

b)structure c)pointer

6) A function which is used to create a text file is ..


a)fprintf()

b)fscanf()

7) For accessing a structure element using a pointer,you must use?


[a]Dot operators(.)

[b]Pointer operator(*)

[c]Arrow operator(->)

8) How will you free the allocated memory ?


A.remove(var-name);
C.delete(var-name);

B.free(var-name);
D.dalloc(var-name);

9)In which data type memory is shared by all members :


a) Union

b)structure

10)If the value is not assigned to variable , which will give a garbage value ?
a) static

b)auto

c)extern

11)which variable is also known as local variable ?


a) auto

b)extern

12)which variable is also known as local variable ?


a) auto

b)extern

Potrebbero piacerti anche