PCBWay

1. Who is father of C Language?

A. James A. Gosling​​
B. Dennis Ritchie
C. Dr. E.F. Codd
​​​D.Bjarne Stroustrup

Answer: Option D

2. C Language developed at _________?

A. AT & T’s Bell Laboratories of USA in 1970
B. Sun Microsystems in 1973
C. AT & T’s Bell Laboratories of USA in 1972
D. Cambridge University in 1972

Answer: Option C

3. For 16-bit compiler allowable range for integer constants is ________?

A.-3.4e38 to 3.4e37​​ ​
​​B.-32757 to 32768
C.-32668 to 32667​​
​​D.-32768 to 32767

Answer: Option D

4. In which the C programs are converted into machine language with the help of _________?

A. A compiler
​​​B.  An Editor
C.  An operating system​​
D.  None of these.

Answer: Option A

5. C was primarily developed as

A. Data processing language ​​
B.  General purpose language
C.  None of the above
​​D.  System programming language

Answer: Option D

6. Standard ANSI C recognizes ______ number of keywords?

A. 30​​​
B. 32
C. 24​​​​​​​​
D. 36​

Answer: Option B

7. What will be printed after execution of the following program code?

main ()
{
printf(“\\nab”);
printf(“\\bsi”);
printf(“\\rha”);
}

A. absiha​ ​​​​​​​​
B. asiha
C. haasi ​​​​​​​​​
D. hai

Answer: Option D

8. Which is the only function all C programs must contain?

A .start()
​​​​​​​​​B. system()
C. main()
​​​​​​​​​D. printf()

Answer: Option C

9. An array elements are always stored in ________ memory locations.

A. Sequentia
l​​​B. Random
C.  Sequential and Random​​
D.  None of the above

Answer: Option A

10. Which of the following special symbol allowed in a variable name?

A. * (asterisk) ​​​
B. | (pipeline)
C. – (hyphen)
​​​D. _ (underscore)

Answer: Option D

11. When we mention the prototype of a function?

A. Defining
​​​B. Declaring
C. Prototyping​​​
D. Calling

Answer: Option B

12. The keyword used to transfer control from a function back to the calling function is

A. switch
​​​B. goto
C. go back​​​
D. return

Answer: Option D

13. In which header file is the NULL macro defined?

A. stdio.h
​​​B. stddef.h
C. stdio.h and stddef.h
​​D. math.h

Answer: Option C

14. If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
A. .​​​
B. $
C.&​​​
D.->

Answer: Option D

15. A pointer is

A. A keyword used to create variables
B. A variable that stores address of an instruction
C. A variable that stores address of other variable
D. All of the above

Answer: Option C

16. The library function used to find the last occurrence of a character in a string is

A. strnstr()​​​
B. laststr()
C. strrchr()​​​
D. strstr()

Answer: Option C

17. In which numbering system can the binary number 1011011111000101 be easily converted to?

A. Decimal system
​​​B.Hexadecimal system
C. Octal system
​​​D. No need to convert

Answer: Option B

18. Which bitwise operator is suitable for checking whether a particular bit is on or off?

A. && operator
​​​B. & operator
C. || operator​​​
D. ! operator

Answer: Option B

19. Input/output function prototypes and macros are defined in which header file?

A. conio.h
​​​B. stdlib.h
C. stdio.h​​​
D. dos.h

Answer: Option C

20. What will the function randomize() do in Turbo C under DOS?

A. returns a random number.
B. returns a random number generator in the specified range.
C. returns a random number generator with a random value based on time.
D. return a random number with a given seed value.

Answer: Option C

21. What are the different types of real data type in C ?

A. float, double​​​
B. short int, double, long int
C. float, double, long double​​
D. double, long int, float

Answer: Option C

22. Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?

A. 3.4E-4932 to 1.1E+4932​​
B. 3.4E-4932 to 3.4E+4932
C. 1.1E-4932 to 1.1E+4932
​​D. 1.7E-4932 to 1.7E+4932

Answer: Option A

23. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.

Answer: Option C

24. How will you free the allocated memory ?

A. remove(var-name);​​
B. free(var-name);
C. delete(var-name);​​
D. dalloc(var-name);

Answer: Option B

25. What do the ‘c’ and ‘v’ in argv stands for?

A. ‘c’ means argument control ‘v’ means argument vector
B. ‘c’ means argument count ‘v’ means argument vertex
C. ‘c’ means argument count ‘v’ means argument vector
D. ‘c’ means argument configuration ‘v’ means argument visibility

Answer: Option C

26. In mathematics and computer programming, which is the correct order of mathematical operators

A. Addition, Subtraction, Multiplication, Division
B. Division, Multiplication, Addition, Subtraction
C. Multiplication, Addition, Division, Subtraction
D. Addition, Division, Modulus, Subtraction

Answer: Option B

27. What does the following declaration mean? Int(*ptr)[10];

A. ptr is array of pointers to 10 integers
B. ptr is a pointer to an array of 10 integers
C. ptr is an array of 10 integers
D. ptr is an pointer to array

Answer: Option B

28. Which one of the following is not a valid identifier?

A. examveda
​​​B.1 examveda
C. exam_veda​​​
D. examveda1

Answer: Option B

29. The maximum combined length of the command-line arguments including the spaces between adjacent arguments is

A. 128 characters​​
B. 256 characters
C. 67 characters
D. It may vary from one operating system to another

Answer: Option D

30. In the following code, the P2 is Integer Pointer or Integer?

typedef int *ptr;
ptr p1, p2;

A. Integer​​​
B. Integer pointer
C. Error in declaration​​
D. None of above

Answer: Option B

31. Which of the following function is used to find the first occurrence of a given string in another string?

A. strchr()​​​
B. strrchr()
C. strstr()
​​​D. strnset()

Answer: Option C

32. The operator used to get value at address stored in a pointer variable is

A. *​​​
B. &
C. &&
​​​D. ||

Answer: Option A

33. What function should be used to free the memory allocated by calloc() ?

A. dealloc();​​​
B. malloc(variable_name, 0)
C. free();
​​​D. memalloc(variable_name, 0)

Answer: Option C

34. Which of the following cannot be checked in a switch-case statement?

A. Character
​​​B. Integer
C. Float
​​​D. enum

Answer: Option C

35. What are the different types of real data type in C ?

A. float, double​​​
B. short int, double, long int
C. float, double, long double
​​D. double, long int, float

Answer: Option C

36. What is the maximum number of dimensions an array in C may have?

A. 2​​
B. 8​​
C. 50
​D.  Theoratically no limit. The only practical limits are memory size and compilers.

Answer: Option D

37. What is (void*)0?

A. Representation of NULL pointer
​B. Representation of void pointer
C. Error​​​
D. None of above

Answer: Option A

38. Which bitwise operator is suitable for turning off a particular bit in a number?

A. && operator
​​​B. & operator
C. || operator​​​
D. ! operator

Answer: Option B

39. What do the following declaration signify?

int *ptr[30];

A. ptr is a pointer to an array of 30 integer pointers.
B. ptr is a array of 30 pointers to integers.
C. ptr is a array of 30 integer pointers.
D. ptr is a array 30 pointers.

Answer: Option B

40. What will the function rewind() do?

A. Reposition the file pointer to a character reverse.
B. Reposition the file pointer stream to end of file.
C. Reposition the file pointer to begining of that line.
D. Reposition the file pointer to begining of file.

Answer: Option D

41. “My salary was increased by 15%” Select the statement, which will EXACTLY reproduce the line of text above.

A.  printf(“My salary was increased by 15/%!”);
B.  printf(“My salary was increased by 15%!”);
C.  printf(“My salary was increased by 15’%’!”);
D.  printf(“My salary was increased by 15%%!”);

Answer: Option D

42. Which header file should be included to use functions like malloc() and calloc()?

A. memory.h​​​
B. stdlib.h
C. string.h​​​
D. dos.h

Answer: Option B

43. What do the following declaration signify?

char **argv;

A. argv is a pointer to pointer.
B. argv is a pointer to a char pointer.
C. argv is a function pointer.
D. argv is a member of function pointer.

Answer: Option B

44. What is the difference between a declaration and a definition of a variable?

A.  Both can occur multiple times, but a declaration must occur first.
B.  A definition occurs once, but a declaration may occur many times.
C.  Both can occur multiple times, but a definition must occur first.
D.  A declaration occurs once, but a definition may occur many times.

Answer: Option D

45. Which of following is not a valid name for a C variable?

A. Examveda
​​​B. Exam_veda
C.  Exam veda​​​
D.  Both A and B

Answer: Option C

46. Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?

A. 3.4E-4932 to 1.1E+4932​​
B. 3.4E-4932 to 3.4E+4932
C. 1.1E-4932 to 1.1E+4932
​​D. 1.7E-4932 to 1.7E+4932

Answer: Option A

47. What will you do to treat the constant 3.14 as a float?

A. use float(3.14f)​​
B. use 3.14f
C. use f(3.14)​​​
D. use (f)(3.14)

Answer: Option B

48. Which of the following operations can be performed on the file “NOTES.TXT” using the below code?

FILE *fp;
fp = fopen(“NOTES.TXT”, “r+”);

A. Reading​​​
B. Writing
C. Appending​​​
D. Read and Write

Answer: Option D

49. In the following code what is ‘P’?

typedef char *charp;
const charp P;

A. P is a constant
​​B. P is a character constant
C. P is character type​​
D. None of above

Answer: Option A

50. What do the following declaration signify?

void (*cmp)();

A. cmp is a pointer to an void function type.
B. cmp is a void type pointer function.
C. cmp is a function that return a void pointer.
D. cmp is a pointer to a function which returns void .

Answer: Option D

51. To print out a and b given below, which of the following printf() statement will you use?

#include<stdio.h>
float a=3.14;
double b=3.14;

A. printf(“%f %lf”, a, b);​​
B. printf(“%Lf %f”, a, b);
C. printf(“%Lf %Lf”, a, b);
​​D. printf(“%f %Lf”, a, b);

Answer: Option A

52. What is stderr ?

A. standard error​​​
B. standard error types
C. standard error streams
​​D. standard error definitions

Answer: Option C

53. Which statement will you add in the following program to work it correctly?

#include<stdio.h>
int main()
{
printf(“%f\n”, log(36.0));
return 0;
}

A. #include<conio.h>
​​B. #include<math.h>
C. #include<stdlib.h>​​
D. #include<dos.h>

Answer: Option B

54. Which standard library function will you use to find the last occurance of a character in a string in C?

A. strnchar()
​​​B. strchar()
C. strrchar()​​​
D. strrchr()

Answer: Option D

55. What will you do to treat the constant 3.14 as a long double?

A. use 3.14LD
​​​B. use 3.14L
C. use 3.14DL
​​​D. use 3.14LF

Answer: Option B

56. What do the following declaration signify?

char *scr;

A. scr is a pointer to pointer variable.
B. scr is a function pointer.
C. scr is a pointer to char.
D. scr is a member of function pointer.

Answer: Option C

57. What is the purpose of fflush() function.

A. flushes all streams and specified streams.
B. flushes only specified stream.
C. flushes input/output buffer.
D. flushes file buffer.

Answer: Option A

58. What is stderr ?

A. standard error ​​
B. standard error types
C. standard error streams
​​D. standard error definitions

Answer: Option C

59. The binary equivalent of 5.375 is

A. 101.101110111
​​​B. 101.011
C. 101011​​​
D. None of above

Answer: Option B

60. What would be the equivalent pointer expression for referring the array element a[i][j][k][l]

A. ((((a+i)+j)+k)+l) ​​
B. *(*(*(*(a+i)+j)+k)+l)
C. (((a+i)+j)+k+l)
​​D. ((a+i)+j+k+l)

Answer: Option B

61. Which of the following function is more appropriate for reading in a multi-word string?

A. printf();
​​​B. scanf();
C. gets();​
D. puts();

Answer: Option C

62. What will you do to treat the constant 3.14 as a long double?

A. use 3.14LD​​​
B. use 3.14L
C. use 3.14DL​​​
D. use 3.14LF

Answer: Option B

63. Which statement will you add in the following program to work it correctly?

#include<stdio.h>
int main()
{
printf(“%f\n”, log(36.0));
return 0;
}

A. #include<conio.h>
​​B. #include<math.h>
C. #include<stdlib.h>
​​D. #include<dos.h>

Answer: Option B

64. What will you do to treat the constant 3.14 as a float?

A. use float(3.14f)
​​B. use 3.14f
C. use f(3.14)
​​​D. use (f)(3.14)

Answer: Option B

65. Which files will get closed through the fclose() in the following program?

#include<stdio.h>
int main()
{
FILE *fs, *ft, *fp; fp = fopen(“A.C”, “r”);
fs = fopen(“B.C”, “r”);
ft = fopen(“C.C”, “r”);
fclose(fp, fs, ft);
return 0;
}

A. “A.C” “B.C” “C.C”​​
B. “B.C” ”
C.C” C. “A.C”​​​
D. Error in fclose()

Answer: Option D

66. What will be printed after execution of the following code?

void main()
{
int arr[10] = {1,2,3,4,5};
printf(“%d”, arr[5]);
}

A. Garbage Value
​​​B. 5
C. 6​​​
D. 0

Answer: Option D

67. What do the following declaration signify?

char *arr[10];

A. arr is a array of 10 character pointers.
B . arr is a array of function pointer.
C. arr is a array of characters.
D. arr is a pointer to array of characters.

Answer: Option A

68. If the two strings are identical, then strcmp() function returns

A. -1​​​
B. 1
C. 0​​​
D. Yes

Answer: Option C

69. Can you combine the following two statements into one?

char *p; p = (char*) malloc(100);

A. char p = *malloc(100);
B. char *p = (char) malloc(100);
C. char *p = (char*)malloc(100);
D. char *p = (char *)(malloc*)(100);

Answer: Option C

70. Which statement will you add in the following program to work it correctly?

#include<stdio.h>
int main()
{
printf(“%f\n”, log(36.0));
return 0;
}

A. #include<conio.h>
​​B. #include<math.h>
C. #include<stdlib.h>​​
D. #include<dos.h>

Answer: Option B

71. Which header file should be included to use functions like malloc() and calloc()?

A. memory.h
​​​B. stdlib.h
C. string.h​​​
D. dos.h

Answer: Option B

72. How will you print \n on the screen?

A. printf(“\n”);
​​​B. echo “\\n”;
C. printf(‘\n’);​​​
D. printf(“\\n”);

Answer: Option D

73. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ?

A. rem = (5.5 % 1.3)​​
B. rem = modf(5.5, 1.3)
C. rem = fmod(5.5, 1.3)​​
D. Error: we can’t divide

Answer: Option C

74. What is the similarity between a structure, union and enumeration?

A. All of them let you define new values
B. All of them let you define new data types
C. All of them let you define new pointers
D. All of them let you define new structures

Answer: Option B

75. Specify the 2 library functions to dynamically allocate memory?

A. malloc() and memalloc()
B. alloc() and memalloc()
C. malloc() and calloc()
D. memalloc() and faralloc()

Answer: Option C

76. What do the following declaration signify?

char **argv;

A. argv is a pointer to pointer.
B. argv is a pointer to a char pointer.
C. argv is a function pointer.
D. argv is a member of function pointer.

Answer: Option B

77. What is right way to Initialize array?

A.  int num[6] = { 2, 4, 12, 5, 45, 5 };
B.  int n{} = { 2, 4, 12, 5, 45, 5 };
C.  int n{6} = { 2, 4, 12 };
D.  int n(6) = { 2, 4, 12, 5, 45, 5 };

Answer: Option A

78. If integer needs two bytes of storage, then maximum value of an unsigned integer is

A.  216 – 1​​​
B.  215 – 1
C. 216
​​​D. 215

Answer: Option A

79. Which standard library function will you use to find the last occurance of a character in a string in C?

A. strnchar()
​​​B. strchar()
C. strrchar()
​​​D. strrchr()

Answer: Option D

80. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

A. The element will be set to 0.
B. The compiler would report an error.
C. The program may crash if some important data gets overwritten.
D. The array size would appropriately grow.

Answer: Option C

81. In which order do the following gets evaluated

1. Relational
2. Arithmetic
3. Logical
4. Assignment

A. 2134
​​​B. 1234
C. 4321​​​
D. 3214

Answer: Option A

82. In which stage the following code #include<stdio.h>
gets replaced by the contents of the file stdio.h

A. During editing
B. During linking
C. During execution
D. During preprocessing

Answer: Option D

83. What do the ‘c’ and ‘v’ in argv stands for?

A. ‘c’ means argument control ‘v’ means argument vector
B. ‘c’ means argument count ‘v’ means argument vertex
C. ‘c’ means argument count ‘v’ means argument vector
D. ‘c’ means argument configuration ‘v’ means argument visibility

Answer: Option C

84. What is the correct value to return to the operating system upon the successful completion of a program?

A. 1​​​
B. -1
C.  0
​​​D.  Program do no return a value.

Answer: Option C

85. What number would be shown on the screen after the following statements of C are executed?

char ch;
int i;
ch = ‘G’;
i = ch-‘A’;
printf(“%d”, i);

A. 5
B. 6
C. 7
D. 8
E. 9

Answer: Option B

86. Which of the following correctly shows the hierarchy of arithmetic operations in C?

A. / + * -​​​
B. * – / +
C. + – / *​​​
D. / * + –

Answer: Option D

87. Which of the following are unary operators in C?

1. !
2. sizeof
3. ~
4. &&

A. 1, 2​​​
B. 1, 3
C. 2, 4​​​
D. 1, 2, 3

Answer: Option D

88. What would be the equivalent pointer expression for referring the array element a[i][j][k][l]

A. ((((a+i)+j)+k)+l)
​​B. *(*(*(*(a+i)+j)+k)+l)
C. (((a+i)+j)+k+l)​​
D. ((a+i)+j+k+l)

Answer: Option B

89. To scan a and b given below, which of the following scanf() statement will you use?

#include<stdio.h>
float a;
double b;

A. scanf(“%f %f”, &a, &b);
​​B. scanf(“%Lf %Lf”, &a, &b);
C. scanf(“%f %Lf”, &a, &b);​​
D. scanf(“%f %lf”, &a, &b);

Answer: Option D

90. What will you do to treat the constant 3.14 as a long double?

A. use 3.14LD​​​
B. use 3.14L
C. use 3.14DL
​​​D. use 3.14LF

Answer: Option B

91. Declare the following statements?

“An array of three pointers to chars”.

A. char *ptr[3]();​​
B. char *ptr[3];
C. char (*ptr[3])();
​​D. char **ptr[3];

Answer: Option B

92. What do the following declaration signify?

int *f();

A. f is a pointer variable of function type.
B. f is a function returning pointer to an int.
C. f is a function pointer.
D. f is a simple declaration of pointer variable.

Answer: Option B

93. Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?

A. 3.4E-4932 to 1.1E+4932​​
B. 3.4E-4932 to 3.4E+4932
C. 1.1E-4932 to 1.1E+4932​​
D. 1.7E-4932 to 1.7E+4932

Answer: Option A

94. What will be printed after execution of the following code?

void main() { int arr[10] = {1,2,3,4,5}; printf(“%d”, arr[5]); }

A. Garbage Value​​​
B. 5
C. 6​​​
D. 0

Answer:Option D

95. Which one of the following is not a reserved keyword for C?

A. auto​​​
B. case
C. main
​​​D. default
E. register

Answer: Option C

96. A C variable cannot start with

A.  A number
​​B.  A special symbol other than underscore
C. Both of the above
D. An alphabet

Answer: Option C

97. Which of the following is not a correct variable type?

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

Answer: Option B

98. Find the output of the following program.

void main()
{
int i=01289;
printf(“%d”, i);
}

A. 0289​​​
B. 1289
C. 713
​​​D. 0713
E. Syntax error

Answer: Option E

99. By default a real number is treated as a

A. Float​​​
B. Double
C. long double
​​​D. far double

Answer: Option B

100. The binary equivalent of 5.375 is

A. 101.101110111​​​
B. 101.011
C. 101011​​​
D. None of above

Answer: Option B