C Programming MCQ Questions and Answers
By Team Alpha | Computer | Jun 12, 2019
C Programming MCQ Questions and Answers downlaod c mcq gk question for all exams
Ans. C (int 3_a;)
Ans. D (216-1)
Ans. C (main( ))
Ans. B (Sequential)
Ans. A (0)
Ans. D (gets( ))
Ans. B (return)
Ans. C (External, Internal and None)
Ans. A (ceil (1.66)
Ans. A (double)
Ans. C (Declaration)
Ans. D (Stdio.h and stddef.h)
Ans. C ( * )
Ans. B (printf(“
”)
Ans. C (stdlib.h)
Ans. A (free( ); )
Ans. C (return;)
Ans. B (volatile)
Ans. A (strcmp( ))
Ans. D (None of these)
- Which one of the following is not a valid variable name declaration?
- int _a3;
- int a_3;
- int 3_a;
- int _3a;
Ans. C (int 3_a;)
- If integer needs 2 bytes of storage, then maximum value of an unsigned integer is?
- 211
- 216 – 1
- 215 – 1
- 216
Ans. D (216-1)
- Which is the only function in all C programs must contain?
- Printf( )
- start ( )
- main ( )
- System ( )
Ans. C (main( ))
- An array elements are always stored in-----------memory locations.
- Random
- Sequential
- Sequential and Random
- None of these
Ans. B (Sequential)
- If the two strings are identical, then strcmp()function returns
- 0
- True
- 1
- None of these
Ans. A (0)
- Which one of the following function is more appropriate for reading in a multi-word string?
- scanf( )
- Printf( )
- puts( )
- gets( )
Ans. D (gets( ))
- What keyword is used to transfer control from a function back to the calling function is
- switch
- return
- goto
- goback
Ans. B (return)
- What are the types of linkages?
- Internal
- External and Internal
- External, Internal and None
- External and None
Ans. C (External, Internal and None)
- How can you round off a value from 1.66 to 2.0?
- Ceil (1.66)
- Roundup (1.66)
- Roundto (1.66)
- Floor (1.66)
Ans. A (ceil (1.66)
- A real number is treated by default as a ________?
- Double
- Float
- Long double
- Far double
Ans. A (double)
- The following statement is a declaration or definition?
extern int i;- Definition
- Function
- Declaration
- Error
Ans. C (Declaration)
- In which header file is the NULL macro defined?
- stddef.h
- math.h
- stdio.h
- stdio.h and stddef.h
Ans. D (Stdio.h and stddef.h)
- Which operator is used to get value at address stored in a pointer variable is?
- &&
- ||
- *
- &
Ans. C ( * )
- How can you print
on the screen?- Echo”\
”; - Printf(“\
”); - Printf(‘
’); - Printf(‘
’);
- Echo”\
Ans. B (printf(“
”)
- Which header file will be included to use functions like malloc()and calloc()?
- dos.h
- string.h
- stdlibh
- memory.h
Ans. C (stdlib.h)
- What function will be used to free the memory allocated by calloc()?
- free( );
- dealloc( );
- malloc( )
- memalloc(variable_name, 0)
Ans. A (free( ); )
- Which keyword will be used for coming out of recursion?
- Break;
- Exit;
- Return;
- None of these
Ans. C (return;)
- What is the invalid identifier from the below?
- __0__
- volatile
- DOUBLE
- Int
Ans. B (volatile)
- What is the built in function to compare 2 strings?
- strcmp( )
- string_cmp( )
- equals( )
- str_compare( )
Ans. A (strcmp( ))
- Which one of the following is an invalid assignment operator?
- a /= 10;
- a %= 10;
- a |= 10;
- None of these
Ans. D (None of these)