C Programming 3

COEP
Lets Crack Online Exam

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

Subject: C Programming 3

Part 3: List for questions and answers of C Language

 

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

a) int number;

b) float rate;

c) int variable_count;

d) int $main;

 

Q2. Which of the following is true for variable names in C?

a) They can contain alphanumeric characters as well as special characters

b) It is not an error to declare a variable to be one of the keywords(like goto, static)

c) Variable names cannot start with a digit

d) Variable can be of any length

 

Q3. The value of automatic variable that is declared but not initialized will be?

a) 0

b) 1

c) Unpredictable

d) None of above

 

Q4 Which of the following is true for variable names in C?

a) They can contain alphanumeric characters as well as special characters

b) It is not an error to declare a variable to be one of the keywords(like goto, static)

c) Variable names cannot start with a digit

d) Variable can be of any length

 

Q5. Which of the following is true for variable names in C?

a) They can contain alphanumeric characters as well as special characters

b) It is not an error to declare a variable to be one of the keywords(like goto, static)

c) Variable names cannot start with a digit

d) Variable can be of any length

 

Q6. Which of the following is true for variable names in C?

a) They can contain alphanumeric characters as well as special characters

b) It is not an error to declare a variable to be one of the keywords(like goto, static)

c) Variable names cannot start with a digit

d) Variable can be of any length 

 

Q7. When we mention the prototype of a function?

a) Defining

b) Declaring

c) Prototyping

d) Calling

 

Q8. All keywords in C are in

a) LowerCase letters

b) UpperCase letters

c) CamelCase letters

d) None

 

Q9. Variable name resolving (number of significant characters for uniqueness of variable) depends on

a) Compiler and linker implementations

b) Assemblers and loaders implementations

c) C language

d) None

 

Q10. The format identifier ‘%i’ is also used for _____ data type?

a) char

b) int

c) float

d) double

 

Q11. Which data type is most suitable for storing a number 65000 in a 32-bit system?

a) signed short

b) unsigned short

c) int

d) float

 

Q12. What are the types of linkages?

a) Internal and External

b) External, Internal and None

c) External and None

d) Internal 

 

Q13. Is there any difference between following declarations? 1 :extern int fun(); 2 :int fun();

a) Both are identical

b) No difference, except extern int fun(); is probably in another file

c) int fun(); is overrided with extern int fun();

d) None of these

 

Q14. How would you round off a value from 1.66 to 2.0?

a) ceil(1.66)

b) floor(1.66)

c) roundup(1.66)

d) roundto(1.66)

 

Q15. By default a real number is treated as a

a) float

b) double

c) long double

d) far double

 

Q16. Which of the declaration is correct?

a) int length;

b) char int;

c) int long;

d) float double;

 

Q17. Which of the following correctly represents a long double constant?

a) 6.68

b) 6.68L

c) 6.68f

d) 6.68LF

 

Q18. Choose the correct statement

a) An identifier may start with an underscore

b) An identifier may end with an underscore

c) IF is a valid identifier

d) All of above 

 

Q19. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

a) rem = 3.14 % 2.1

b) rem = modf(3.14, 2.1);

c) rem = fmod(3.14, 2.1);

d) Remainder cannot be obtain in floating point division

 

Q20. Any type of modification on the parameter inside the function will reflect in actual variable value can be related to

a) call by value

b) call by reference

c) both of above

d) none of above 

 

Part 3: List for questions and answers of C Language

 

Q1. Answer: d

 

Q2. Answer: c

 

Q3. Answer: c

 

Q4. Answer: c

 

Q5. Answer: c

 

Q6. Answer: c

 

Q7. Answer: b

 

Q8. Answer: a

 

Q9. Answer: a

 

Q10. Answer: b

 

Q11. Answer: b

 

Q12. Answer: b

 

Q13. Answer: b

 

Q14. Answer: a

 

Q15. Answer: b

 

Q16. Answer: a

 

Q17. Answer: b

 

Q18. Answer: d

 

Q19. Answer: c

 

Q20. Answer: b