Capgemini and Hexaware C Programming MCQs: Study Material 2020-2021 Batch

Capgemini and Hexaware Study Material: Last year placement papers:

Capgemini Study Material 2020-2021 Batch includes Capgemini Aptitude Questions, Capgemini Logical Reasoning Questions, Capgemini Technical Programming Questions, Capgemini Pseudo Code Questions with Explanation, Capgemini Sample Verbal Ability Questions, C Programming MCQs

Must Read:

Capgemini C Programming MCQs: Capgemini Study Material

Q1. C Programming Language is often called as :

a) High Level Language

b) Middle Level Language

c) Low Level Language

d) None of these

 

(b)

 

Q2. Which of the following is true about C programming language ?

a) C is a structural language.

b) C is a procedural language.

c) C does not supports function within function.

d) All of these

 

(d)

 

Q3. How many keywords are there in Standard C programming language ?

a) 32

b) 28

c) 21

d) 44

 

(d)

Q4. Which is not the extended keyword in C ?

a) _Imaginary

b) _Complex

c) inline

d) None of these

 

(d)

Q5. Process in which source code is combined with object code is termed as :

a) Linker

b) Loading

c) Linking

d) None of these

 

(c)

Q6. An object of type ‘char’ is of :

a) 1 byte

b) 2 bytes

c) 4 bytes

d) 8 bytes

 

(a)

 

Q7. For 32 bits environment, size of ‘int’ data type is :

a) 2 bytes

b) 4 bytes

c) 8 bytes

d) None of these

 

(b)

 

Q8. What is the minimal range of unsigned char data type ?

a) -127 to 127

b) 0 to 255

c) -32767 to 32767

d) None of these

 

(b)

Q9. In C, the names of variables, functions, labels, and various other user-defined items are :

a) keywords

b) Tokens

c) Identifiers

d) None of these

 

(c)

Q10. Variables that are declared inside a function are :

a) constants

b) literals

c) global

d) local

 

(d)
Q11. All non-global variables are by default :

a) auto

b) static

c) extern

d) register

 

(a)

 

Q12. You can direct the compiler to retail the values of local variables using _____ modifier.

a) auto

b) static

c) extern

d) register

 

(b)

 

Q13. main() is :

a) keyword

b) function

c) both

d) None of these

 

(b)

Capgemini C Programming MCQs

Q14. This modifier tells the compiler that the value of the variable may change at any time – without any action being taken by the code the compiler finds nearby.

a) extern

b) public

c) void

d) volatile

 

(d)

Q15. Variables with ____ keyword are only declared not defined.

a) auto

b) extern

c) static

d) register

 

(b)
Q16. Which of the following statement about ‘static variables’ is false ?

a) Static variables are permanent variables within their own function or file.

b) Static local variables are not known outside the function or file.

c) Static variables maintain their values during function calls.

d) Static variables and global variables are same.

 

(d)

 

Q17. Which operator is used to return the length of the variables in bytes ?

a) size()

b) length()

c) leng()

d) sizeof()

 

(d)

 

Capgemini C Programming MCQs

Q18. The format identifier ‘%i’ is also used for :

a) char

b) int

c) float

d) double

 

Q19. Which data type is best for storing a number 65000 in a 32-bit system ?

a) int

b) long

c) signed short

d) unsigned short

 

(d)

Q20. Which header file can be used to define i/o function prototypes and macros?

a) stdio.h

b) conio.h

c) stdlib.h

d) alloc,h

 

(a)
Q21. Which of the following is an invalid if-else statement ?

a) if (if (a == 1)){}

b) if (func1 (a)){}

c) if (a){}

d) if ((char) a){}

 

(a)

Q22. According to ANSI specification, how to declare main () function with command-line arguments ?

a) int main(int argc, char *argv[])

b) int char main(int argc, *argv)

c) Both of the above

d) None of the above

 

(a)

Q23. const int *ptr;. Which statement is true ?

a) You cannot change the value pointed by ptr
b) You cannot change the pointer ptr itself
c) You May or may not change the value pointed by ptr
d) You can change the pointer as well as the value pointed by it

 

(a)

Q24. _____ is used to break out of a program ?

a) break

b) continue

c) terminate

d) exit

 

(d)

Capgemini C Programming MCQs
Q25. Which is an indirection operator among the following?

a) &

b) $

c) *

d) .

 

(c)

Q26. Which of the following does not initialize ptr to null (assume a = 0) ?

a) int *ptr = &a;

b) int *ptr = &a – &a;

c) int *ptr = a – a;

d) All of the mentioned

 

(a)

Q27. If :

char s[10],*p;
p = s;
C++
then, s[i] can be written as :

a) s – i

b) p + i

c) *(s + i)

d) *(p + i)

 

(d)

Q28. When a function is called by itself again and again, then it is :

a) call by value

b) call by reference

c) recursion

d) system function call

 

(c)

Q29. Which can never be called by value using call by value method ?

a) structure

b) union

c) array

d) all of these

 

(c)

Q30. What is the maximum number of arguments that can be passed in a single function ?

a) 341

b) 263

c) 253

d) 308

 

(c)
Q31. _____ is the collection of similar-type elements ?

a) Structure

b) Union

c) Array

d) String

 

(c)

Q32. Which is true about following statement in C :

void ( * abc( int, void ( *def) () ) ) ();

a) abc is a pointer variable to pointer-type function def.

b) Illegal statement

c) abc is a ptr to a function which takes 2 parameters.

d) None of the above

 

(c)

Q33. What can not be declared :

a) Array of integers
b) Array of pointers
c) Array of structures
d) None of the above

 

(d)

Capgemini C Programming MCQs

Q34. Which of the following is not a arithmetic operation :

a) n/=10

b) n*=10

c) n+=10

d) n!=10

 

(d)

Q35. Which datatype is not applicable for mod(%) operation ?

a) int

b) float

c) char

d) None of these

 

(b)
Q36. Functions with same name and different parameters represents :

a) function overloading

b) function overriding

c) recursion

d) None of the mentioned

 

(a)

Q37. getch() is present in this header file

a) stdio.h

b) conio.h

c) stdlib.h

d) None of the mentioned

 

(b)

Q38. This keyword is used for defining new data type names.

a) docstring

b) typedef

c) Both of them

d) None of them

 

(b)

Q39. Which precision specifier the number of significant digits ?

a) %g

b) %G

c) %f

d) Both a and b

 

(d)

Capgemini C Programming MCQs
Q40. In order to display address, we need :

a) %q

b) %a

c) %p

d) None of the mentioned

 

(c)

Q41. _____ is used to take user input in C.

a) input()

b) printf()

c) scanf()

d) None of the above

 

(c)

Q42. ‘%[ ]’ is used for :

a) taking array as input

b) scans for set of characters

c) takes integer as input

d) None of the above

 

(b)

Q43. To avoid repetition of code and bulky programs, statements are isolated inside a _____.

a) Functions
b) Modules
c) Header Files
d) None of the above

 

(a)

Q44. In C, order of passing arguments to a function is done :

a) left to right

b) right to left

c) Randomly

d) Manualy

 

(b)

Q45. pow() is present in which header file ?

a) maths.h

b) arithmetic.h

c) process.h

d) math.h

 

(d)
Q46. In pointers, meaning of ‘*’ is :

a) pointer variable

b) value at address

c) value of address

d) None of the mentioned

 

(b)

Capgemini C Programming MCQs

Q47. When double is converted to float then the value is ?

a) Truncated

b) Rounded

c) Depends upon compiler

d) None of the mentioned

 

(c)

Q48. Can we declare function inside structure of C ?

a) YES

b) NO

c) Both of them

d) None of them

 

(b)

Q49. Which of the following is an ternary operator in C?

a) &&

b) %%

c) !=

d) ?:

 

(d)

Q50. What is the use of ‘%%’ specifier ?

a) Finding remainder

b) Finding quotient

c) Printing % sign

d) None of the mentioned

 

(c)

 

Leave a Comment