MCQ - C Programming II
MCQ - C Programming II
Question - 1
a) String
b) Structure
c) char
d) All of the mentioned
Answer Key: B
Question - 2
a) Another Structure
b) Function
c) Array
d) None of the variable name
Answer Key: B
Question - 3
a) Syntax Error
b) Structure
c) Double data type
d) An ordinary variable name
Answer Key: B
Question - 4
Answer Key: A
Question - 5
Answer Key: D
Question - 6
a) Printf
b) fprintf
c) putcher
d) scanf
Answer Key: D
Question - 7
a) scanf
b) Files
c) Command -line
d) All of the mentioned
Answer Key: A
Question - 8
What will fopen will return, if there is any error while opening a file ?
a) Nothing
b) EOF
c) NULL
d) Depends of the mentioned
Answer Key: C
Question - 9
a) Standard input
b) Standard output
c) Standard error
d) All of the mentioned
Answer Key: D
Question - 10
a) Attach
b) Append
c) Apprehend
d) Add
Answer Key: B
Question - 11
Answer Key: D
Question - 12
a) Sell Function
b) Auto Function
c) Recursive Function
d) Static Function
Answer Key: D
Question - 13
a) Library Functions
b) User Defined Functions
c) Both a and b
d) None of the above
Answer Key: D
Question - 14
a) 1
b) 16
c) 32
d) None of the above
Answer Key: D
Question - 15
a) 0
b) 1
c) 0 or 1
d) More than 1
Answer Key: C
Question - 16
a) Print()
b) show()
c) scanf ()
d) main()
Answer Key: D
Question - 17
a) 1
b) 2
c) 3
d) 4
Answer Key: A
Question - 18
a) Formal arguments
b) Actual Arguments
c) Definite Arguments
d) Ideal Arguments
Answer Key: B
Question - 19
a) Definite Arguments
b) Formal arguments
c) Actual Arguments
d) Ideal Arguments
Answer Key: B
Question - 20
a) printf
b) scanf
c) void
d) return
Answer Key: D
Question - 21
a) auto
b) static
c) extern
d) register
Answer Key: A
Question - 22
a) 0
b) 1
c) garbage
d) None of the above
Answer Key: C
Question - 23
a) 0
b) 1
c) garbage
d) None of the above
Answer Key: A
Question - 24
Which of the variable will not get its space from RAM?
a) Auto
b) extern
c) static
d) register
Answer Key: D
Question - 25
a) register
b) auto
c) static
d) extern
Answer Key: B
Question - 26
a) auto
b) register
c) static
d) extern
Answer Key: D
Question - 27
Answer Key: B
Question - 28
a) Array
b) Structure
c) Function
d) Pointer
Answer Key: C
Question - 29
a) First member
b) Largest member
c) Sum of size of all member
c) None of the above
Answer Key: B
Question - 30
a)
b) ->
c) Both A and B
d) d) None of the above
Answer Key: C
Question - 31
a) Array
b) Function
c) Pointer
d) structure
Answer Key: D
Question - 32
a) &
b) b) *
c) []
d) ->
Answer Key: A
Question - 33
a) &
b) b) *
c) []
d) ->
Answer Key: B
Question - 34
a) &a
b) &x[5]
c) &(a+2)
d) None of the above
Answer Key: C
Question - 35
a) m is constant
b) Value of m is always & [0].
c) Both a & b
d) Only A.
Answer Key: C
Question - 36
Which is true?
Answer Key: B
Question - 37
a) Call by value
b) call by reference
c) Both a and b
d) None of the above
Answer Key: B
Question - 38
a) RAM
b) ROM
c) Hard disk
d) All of the above
Answer Key: C
Question - 39
What is the output of this C code?
#include <stdio.h>
main()
{
int n = 0, m = 0;
if (n > 0)
if (m > 0)
printf("True");
else
printf("False");
}
a) True
b) False
c) No Output will be printed
d) Run Time Error Answer Key: C
Question - 40
What will be the data type returned for the following C function?
#include <stdio.h>
int func()
{
return (double)(char)5.0;
}
a) char
b) int
c) double
d) multiple type-casting
Answer Key: B
Question - 41
Library function used to set the file pointer to desired location is _____
a) rewind
b) tell
c) fseek
d) remove
Answer Key: C
Question - 42
a) fputs
b) fscanf
c) fwrite
d) fread
Answer Key: C
Question - 43
a) Text
b) Binary
c) Both A & B
d) None of the Above
Answer Key: B
Question - 44
a) fseek
b) remove
c) rewind
d) None of the above
Answer Key: B
Question - 45
a) getw
b) fwrite
c) fcanf
d) None of the above
Answer Key: D
Question - 46
a) Variable
b) identifier
c) Keyboard
d) None of the above
Answer Key: C
Question - 47
a) Variable
b) Constant
c) data type
d) None of the above
Answer Key: B
Question - 48
___________is a symbolic name, which is used to store different types
of data in the computer’s memory and may change during the program
execution.
a) Variable
b) Constant
c) identifier
d) None of the above
Answer Key: A
Question - 49
a) Operand
b) Operation
c) Operator
d) None of the above
Answer Key: C
Question - 50
a) Operand
b) Operation
c) Operator
d) None of the above
Answer Key: A
Question - 51
a) print()
b) Scanf()
c) variable
d) None of the above
Answer Key: A
Question - 52
a) print()
b) scanf()
c) variable
d) None of the above
Answer Key: B
Question - 53
a) Looping
b) variable
c) Constant
d) None of the above
Answer Key: A
Question - 54
a) Structure
b) array
c) Function
d) None of the above
Answer Key: B
Question - 55
a) Array
b) function
c) Structure
d) None of the above
Answer Key: B
Question - 56
Answer Key: D
Question - 57
Answer Key: D
Question - 58
a) Self – function
b) Auto - function
c) Recursive Function
d) Static function
Answer Key: C
Question - 59
Answer Key: B
Question - 60
Answer Key: B
Question - 61
a) 1
b) 2
c) 3
d) 4
Answer Key: A
Question - 62
a) 1
b) 2
c) 3
d) 4
Answer Key: A
Question - 63
a) Formal arguments
b) Actual arguments
c) Definite arguments
d) Ideal arguments
Answer Key: B
Question - 64
Answer Key: A
Question - 65
Answer Key: A
Question - 66
Answer Key: B
Question - 67
Answer Key: B
Question - 68
a) string
b) Struct
c) char.
d) All of the mentioned
Answer Key: B
Question - 69
Answer Key: D
Question - 70
Answer Key: D
Question - 71
a) union-name.member
b) union-pointer->member
c) a) and b)
d) none of the mentioned
Answer Key: C
Question - 72
a) print()
b) fprint()
c) puts ()
d) fputs()
Answer Key: B
Question - 73
A made which is used to open an existing file foe both reading and writing…
a) “W”
b) “W+”
c) “A+”
d) “R+”
Answer Key: D
Question - 74
a) “W”
b) “W+”
c) “A+”
d) “R+”
Answer Key: D
Question - 75
a) Steve Jobs
b) James Gosling
c) Dennis MacAlistair Ritchie
d) Rasmus Lerdorf
Answer Key: C
Question - 76
a) int number;
b) float rate;
c) int variable_count;
d) int $main;
Answer Key: D
Question - 77
Answer Key: C
Question - 78
Answer Key: B
Question - 79
a) volatile
b) true
c) friend
d) export
Answer Key: A
Question - 80
Answer Key: C
Question - 81
a) String str;
b) b) char *str;
c) c) float str = 3e2;
d) d) a) and c)
Answer Key: A
Question - 82
a) for
b) while
c) do-while
d) all of the mentioned
Answer Key: D
Question - 83
a) Internal
b) External
c) Both Internal and External
d) External and Internal are not valid terms for functions
Answer Key: B
Question - 84
a) Preprocessor directive
b) Inclusion directive
c) File inclusion directive
d) None of the mentioned
Answer Key: A
Question - 85
a) #ifdef
b) #define
c) #endif
d) all of the mentioned
Answer Key: D
Question - 86
a) #
b) $
c) ” ”
d) &
Answer Key: A
Question - 87
How many number of pointer (*) does C have against a pointer variable
declaration?
a) 7
b) 127
c) 255
d) No limits
Answer Key: D
Question - 88
a) int
b) char *
c) struct
d) None of the mentioned
Answer Key: C
Question - 89
a) 1 bit
b) 2 bits
c) 1 Byte
d) 2 Bytes
Answer Key: C
Question - 90
a) ,
b) sizeof()
c) c) ~
d) d) None of the mentioned
Answer Key: D
Question - 91
a) stdlib. h
b) ctype. h
c) stdio. h
d) stdarg. h
Answer Key: C
Question - 92
a) Attach
b) Append
c) Apprehend
d) Add
Answer Key: B
Question - 93
a) 8
b) 5
c) 9
Answer Key: D
d) 4
Question - 97
a) 3.75
b) Depends on compiler
c) 24
d) 3
Answer Key: C
Question - 98
a) 7.000000, 7
b) Run time errorc) 7.000000, junk
d) Varies
Answer Key: C
Question - 99
Answer Key: D
Question - 100
a)Output will be 3, 2
b) Output will be 3, 1
c) Output will be 6, 1
d) Output is compiler dependent
Answer Key: D
Question - 101
How many times i value is checked in the following C program?
#include <stdio.h>
int main()
{
int i = 0;
while (i < 3)
i++;
printf("In while loop\n");
}
a)Output will be 3, 2
b) Output will be 3, 1
c) Output will be 6, 1
d) Output is compiler dependent
Answer Key: C
Question - 102
a) 0
b) 1
c) 2
d) 4
Answer Key: A
Question - 103
a) auto
b) extern
c) static
d) register
Answer Key: D
Question - 104
a) auto
b) extern
c) static
d) register
Answer Key: B
Question - 105
Answer Key: B
Question - 106
a) Returns an Integer
b) Returns a non-integer value
c) Is not defined in the same file
d) None of these
Answer Key: B
Question - 107
Answer Key: C
Question - 108
The declaration:
void function1(int)
indicates the function1 is a function which
a) Has no arguments
b) Returns nothing
c) Both a) and b)
d) None of these
Answer Key: B
Question - 109
a) When too many printf calls have been alrady used in the program
b) In place of printf, since printf uses more memory
c) When output i to be printed on to a file
d) All of above
Answer Key: C
Question - 110
a) Decision making
b) Variable declaration
c) Printing Output
d) Code reusability
Answer Key: D
Question - 111
a) By value
b) By reference
c) By pointer
c) By address
Answer Key: A
Question - 112
a) int func();
b) func(int);
c) func();
d) int func(int);
Answer Key: C
Question - 113
Answer Key: C
Question - 114
a) int
b) void
c) float
d) char
Answer Key: D
Question - 115
Answer Key: A
Question - 116
a) struct
b) record
c) class
d) object
Answer Key: A
Question - 117
a) variables
b) properties
c) objects
d) elements
Answer Key: A
Question - 118
a) &
b) ::
c) ,
d) .
Answer Key: D
Question - 119
a) struct
b) union
c) class
d) typedef
Answer Key: B
Question - 120
Answer Key: B
Question - 121
Answer Key: A
Question - 122
Answer Key: C
Question - 123
What will be output?
union test
{
int x;
char arr[8];
int y;
};
int main()
{
printf("%d", sizeof(union test));
return 0;
}
a) 12
b) 16
c) 8
Answer Key: C
d) Compile Error
Question - 124
a) String
b) Array
c) Structure
d) Files
Answer Key: A
Question - 125
a) fields
b) members
c) components
d) All of the above
Answer Key: D
Question - 126
Define new data type equivalent to the existing system data type using
the ______ statement.
a) typedef
b) struct
c) array
d) union
Answer Key: A
Question - 127
a) int *p
b) int *p[void]
c) int *p[char *a]
d) int *p[10]
Answer Key: A
Question - 128
a) int *p
b) int *p[void]
c) int *p[char *a]
d) int *p[10]
Answer Key: B
Question - 129
a) int *p
b) int *p[void]
c) int *p[char *a]
d) int *p[10]
Answer Key: D
Question - 130
a) int *p
b) int *p[void]
c) int *p[char *a]
d) int *p[10]
Answer Key: C
Question - 131
Used for opening the file for both reading and writing. The file must
already exist before performing the operation.
a) a+
b) r+
c) w+
d) o+
Answer Key: B
Question - 132
The _____ function lets us move the pointer from one record to another.
a) move ( )
b) cut( )
d) rewind( )
d) fseek( )
Answer Key: D
Question - 133
a) int p*;
b) int *p;
c) int +p;
d) int $p;
Answer Key: B
Question - 134
a) Passed to a function
b) Changed within function
c) Returned by a function
d) Can be assigned integer
Answer Key: C
Question - 135
a) 24
b) 34
c) 22
d) 23
Answer Key: D
Question - 136
Answer Key: B
Question - 137
a) Integer
b) Float
c) Array
d) Character
Answer Key: A
Question - 138
Answer Key: B
Question - 139
a) float ptr;
b) float *ptr;
c) *float ptr;
d) None of the above
Answer Key: B
Question - 140
A mode which is used to open an existing file for both reading and
writing ______
a) ”W”
b) ”W+”
c) ”R+”
d) ”A+”
Answer Key: C
Question - 141
a) pits()
b) putc()
c) fputs()
d) fgets()
Answer Key: C
Question - 142
a) fscanf()
b) getch()
c) fgetc()
d) fgets()
Answer Key: C
Question - 143
a) printf()
b) fprintf()
c) puts()
d) fputs()
Answer Key: B
Question - 144
a) printf()
b) fprintf()
c) puts()
d) fputs()
Answer Key: B
Question - 145
Select a program which get input data from datafile and also send output
into datafile ,it is called _____
a) files
b) file processing
c) data files
d) file handling
Answer Key: D
Question - 146
a) ASCII code
b) Binary code
c) Octal code
d) Text code
Answer Key: A
Question - 147
a) 2 bytes
b) 4 bytes
c) 3 bytes
d) 8 bytes
Answer Key: B