Answer these 70+ Programming with C MCQs and see how sharp is your knowledge of Programming with C.
Scroll down and let's start!
A. ftell()
B. fseek()
C. fgetc()
D. fread()
E. fscanf()
A. fputc()
B. fputs()
C. fprintf()
D. fseek()
E. ftell()
A. 7
B. 7.00
C. 7.000000
D. 7.5
E. 7.50
A. Hello World!
B. Hello World
C. Hello
D. The code snippet will throw a compilation error
A. The first command line parameter has been passed to the program
B. The program name
C. The number of command line arguments
D. None of the above
A. For statement 1, the header file will be searched first in the local directory and then in the standard system directories such as
B. For statement 1, the header file will be searched in the standard system directories such as
C. For statement 2, the header file will be searched first in the local directory and then in the standard system directories such as
D. For statement 2, the header file will be searched in the standard system directories such as
E. None of the above
A. 22
B. 2,2
C. 2
D. none of the above
A. stdio.h
B. ctype.h
C. string.h
D. math.h
E. None of the above
A. char str[2][4]={
"abc",
B. char str[2][4]={
{"abc"},
 
C. char str[2][4]={
{'a','b','c','\0'},
&nbs
D. a and b
E. a, b and c
A. 2
B. 3
C. 5
D. 6
E. 9
A. w+
B. a+
C. r+
D. r+a
E. a+r
A. Assertion 'n > 3' failed; Program aborts at statement 1
B. Assertion 'n > 7' failed; Program aborts at statement 2
C. Program returns 0 with the value of n as 7
D. Compilation Error
A. 6 7 8
B. 5 7 8
C. 6 8 8
D. 5 8 8
E. None of the above
A. atoi()
B. atof()
C. atol()
D. atan()
E. acos()
A. r
B. w
C. a
D. r+
E. i
A. strcmp()
B. strcpy()
C. strcat()
D. strlen()
E. catstr()
A. Will result in Compilation Error
B. 0 1 2 3
C. 0 1 0 1
D. 0 1 0 2
E. Undefined
A. p is an array of pointers to functions the return type of which is an integer
B. p is a pointer to a function that returns a pointer to an integer
C. p is a pointer to an array of integers
D. p is a pointer to an array of integer pointers
E. p is a pointer to a character string
A. char amessage[] =
B. char *pmessage =
C. char amessage[] =
D. char *pmessage = "abcde"; pmessage++;
A. case : 1
B. case : 2
C. case : 3
D. Result in compilation error
E. None of the above
A. 2
B. 3
C. 4
D. 5
E. 6
A. auto
B. global
C. static
D. register
E. extern
A. The function definition {...} is missing
B. While calling a function, the type int is not needed
C. No parameter has been passed
D. The semicolon should not be there
E. There is nothing wrong with the statement
A. 1,2,3
B. 1,2
C. 2,3
D. 2
E. None of the above
A. fputc()
B. fputs()
C. fprintf()
D. fscanf()
E. ftell()
A. Returns the minimum number of bits required to represent the number x
B. Returns the number of zero bits present in the number x
C. Returns the number of 1 bits(bits having one) in the number x
D. Returns the square root of the number
E. None of the above
A. 2 2 2 2 2 2
B. 2 2 3 2 4 2
C. 2 2 2 3 2 4
D. 2 2 3 3 4 4
E. None of these
A. Automatic arrays cannot be initialized
B. An array declared as A[100][100] can hold a maximum of 10000 elements
C. An array can hold elements of different data types
A. fileclose()
B. closefile()
C. fclose()
D. Any of the above
A. assign()
B. calloc()
C. malloc()
D. swab()
E. allocate()
A. Will result in Compilation Error
B. Undefined string
C. sdfgh
D. asdfgh
A. Results in Compilation Error
B. 6 4 5
C. 6 5 7
D. 6 5 6
E. None of the above
A. 1 4
B. 0 1
C. Undefined value
D. Compilation Error in "Line 1"
E. Compilation Error in "Line 2"
A. 1,1
B. 1,4
C. 8,8
D. 8,9
E. 9,10
A. 1
B. 2
C. 4
D. 5
E. Cannot be determined
A. 3
B. 4
C. 5
D. 6
E. 7
A. The loop will run infinitely
B. The program will not enter the loop
C. There will be a compilation error
D. A runtime error will be reported
A. int main(int argc, char **argv)
B. int main(int argc, char *argv[])
C. int main(int argc, char *argv)
D. int main(int argc, char argv[])
E. All of the above
A. 10
B. 9
C. 11
D. 8
E. None of the above
A. The size of the operator cannot be applied to an array
B. There is nothing wrong with the code snippet. The value of the size will be 6
C. There is nothing wrong with the code snippet. The value of the size will be 7
D. An extern array of unspecified size is an incomplete type. The size of the operator during compile time is unable to learn the size of an array that is defined in another file
E. None of the above
A. It is a storage-class-specifier
B. It guarantees that the variable is kept in the CPU register for maximum speed
C. It requests that the variable be kept in the CPU register for maximum speed
D. It does not guarantee that the variable value is kept in CPU register for maximum speed
A. Rational
B. Unary
C. Ternary
D. Compound assignment
E. Logical
A. An error will occur
B. a
C. A
D. b
E. c
A. free
B. calloc
C. delete
D. release
E. destroy
A. 0
B. 1
C. 3
D. 4
E. Cannot be determined
A. 0
B. 1
C. 3
D. 4
E. Cannot be determined
A. -1L < 1U
B. -1L > 1U
C. -1L < 1UL
D. -1L > 1UL
A. int n=5, x; x=n++;
B. int n=5, x; x= ++n++;
C. int n=5, x; x= (n+1)++;
D. int n=5, x=6; x= (n+x)++;
E. None of the above
A. Yes, the size is three columns by two rows
B. Yes, the size is two columns by two rows
C. No, the first dimension is omitted
D. No, one of the three initializer sets contains too many numbers
E. Yes, the size is three columns by three rows
A. fn(int arr[4][10])
B. fn(int arr[][10])
C. fn(int arr[4][])
D. fn(int (*fn)[13])
E. None of the above