C Programming 14

COEP
Lets Crack Online Exam

IT Interview Exam Questions: C Programming 14 (IT Interview Exam Question, IT Campus Placement)

Subject: C Programming 14

Part 14: List for questions and answers of C Language

 

Q1. An external variable

a) is globally accessible by all functions

b) has a declaration

c) will be initialized to 0 if not initialized

d) all of these

 

Q2. The declaration “unsigned u” indicates u is a/an

a) unsigned character

b) unsigned integer

c) character

d) none of’ these

 

Q3. A declaration “short int” is used for variables

a) which have a short duration in a program

b) which have short names

c) which may require less storage than normal integers

d) all of these

 

Q4. Which of the following ‘C’ type is not a primitive data structure?

a) int

b) float

c) char

d) none of these

 

Q5. Printing a character as an integer

a) results in the printing of a negative integer

b) always prints a positive integer

c) prints a value that is implementation dependent

d) none of these

 

Q6. The program fragment int i = 263 ; putchar (i) ; prints

a) 263

b) ASCII equivalent of 263

c) rings the bell

d) garbage 

 

Q7. int i = 5; is a statement in a C program

a) during execution, value of i may change but not its address

b) during execution both the address and value may change

c) repeated execution may result in different addresses for i

d) i may not have an associated address

 

Q8. If the declaration unsigned c:5; is replaced by unsigned : 6; then

a) it results in a syntax error

b) it is meaningless

c) compiler will give a new name for the field

d) none of these

 

Q9. The value of ab if ab & 0 x 3f equals 0 x 27 is

a) 047

b) 0 x 0 f

c) 0 x f3

d) 0 x 27

 

Q10. In C programming language, if the first and the second operands of operator + are of types int and float, respectively, the result will be of type

a) int

b) float

c) char

d) long int

 

Q11. C programming language provides operations which deal directly with objects such as

a) strings and sets

b) lists and arrays

c) characters, integers, and floating point numbers

d) all of these

 

Q12. C programming language by itself provides

a) input facility

b) output facility

c) both input and output facilities

d) no input and output facilities 

 

Q13. The variables which can be accessed by all modules in a program, are called

a) local variables

b) internal variables

c) external variable

d) global variables

 

Q14. The rule for implicit type conversion in ‘C’ is

a) int is less than unsigned is less than float is less than double

b) unsigned is less than int is less than float is less than double

c) int is less than unsigned is less than double is less than float

d) unsigned is less than int is less than double is less than float

 

Q15. Consider the statement #define hypotenuse (a, b) sqrt (a*a + b*b); 

The macro-call hypotenuse (a + 2, b + 3);

a) finds hypotenuse of triangle with sides a + 2 and b+3

b) finds square root of (a + 2)2 + (b + 3)2

c) is meaningless

d) finds square root of 3*a + 4*b + 5

 

Q16. A static variable

a) cannot be initialized

b) is initialized once at the commencement of execution and cannot be changed at run time

c) retains its value throughout the file of the program

d) is same as an automatic variable but is placed at the head of a program

 

Q17. The statement # include ( math.h) is written at the top of a program to indicate

a) beginning of the program

b) beginning of the program

c) that certain information about mathematical library functions are to be included at the begnning of the program

d) none of these

 

Q18. The declarations typedef float hight [100];height men, women;

a) define men and women as 100 element floating point arrays

b) define men and women as floating point variables

c) define height, men and women as floating point variables

d) are illegal 

 

Q19. In case of ordinary int variables

a) leftmost bit is reserved for sign

b) rightmost bit is reserved for sign

c) no bit is reserved for sign

d) none of these

 

Q20. If a is an unsigned integer variable whose value is hx6db7, what is the value of -a?

a) h llhhhhl

b) hxhhl

c) hx248

d) hx9248 

 

Part 14: List for questions and answers of C Language

 

Q1. Answer: d

 

Q2. Answer: b

 

Q3. Answer: c

 

Q4. Answer: d

 

Q5. Answer: c

 

Q6. Answer: c

 

Q7. Answer: c

 

Q8. Answer: d

 

Q9. Answer: d

 

Q10. Answer: b

 

Q11. Answer: c

 

Q12. Answer: d

 

Q13. Answer: d

 

Q14. Answer: a

 

Q15. Answer: d

 

Q16. Answer: c

 

Q17. Answer: c

 

Q18. Answer: a

 

Q19. Answer: a

 

Q20. Answer: d