C Programming MCQ Questions and Answers

C Programming MCQ Questions and Answers downlaod c mcq gk question for all exams

  1. Which one of the following is not a valid variable name declaration?
    1. int _a3;
    2. int a_3;
    3. int 3_a;
    4. int _3a;

Ans. C (int 3_a;)   

 

  1. If integer needs 2 bytes of storage, then maximum value of an unsigned integer is?
    1. 211
    2. 216 – 1
    3. 215 – 1
    4. 216

   Ans.  D (216-1)

 

  1. Which is the only function in all C programs must contain?
    1. Printf( )
    2. start ( )
    3. main ( )
    4. System ( )

Ans. C (main( ))

 

  1. An array elements are always stored in———–memory locations.
    1. Random
    2. Sequential
    3. Sequential and Random
    4. None of these

Ans. B (Sequential)

 

  1. If the two strings are identical, then strcmp()function returns
    1. 0
    2. True
    3. 1
    4. None of these

Ans. A (0)

 

  1. Which one of the following function is more appropriate for reading in a multi-word string?
    1. scanf( )
    2. Printf( )
    3. puts( )
    4. gets( )

           Ans. D (gets( ))

 

  1. What keyword is used to transfer control from a function back to the calling function is
    1. switch
    2. return
    3. goto
    4. goback

Ans. B (return)

 

  1. What are the types of linkages?
    1. Internal
    2. External and Internal
    3. External, Internal and None
    4. External and None

Ans. C (External, Internal and None)

 

  1. How can you round off a value from 1.66 to 2.0?
    1. Ceil (1.66)
    2. Roundup (1.66)
    3. Roundto (1.66)
    4. Floor (1.66)

               Ans. A (ceil (1.66)

 

  1. A real number is treated by default as a ________?
    1. Double
    2. Float
    3. Long double
    4. Far double

                 Ans. A (double)

 

  1. The following statement is a declaration or definition?
    extern int i;

    1. Definition
    2. Function
    3. Declaration
    4. Error

       Ans. C (Declaration)

 

  1. In which header file is the NULL macro defined?
    1. stddef.h
    2. math.h
    3. stdio.h
    4. stdio.h and stddef.h

Ans. D (Stdio.h and stddef.h)

 

  1. Which operator is used to get value at address stored in a pointer variable is?
    1. &&
    2. ||
    3. *
    4. &

Ans. C ( * )

 

  1. How can you print \n on the screen?
    1. Echo”\\n”;
    2. Printf(“\\n”);
    3. Printf(‘\n’);
    4. Printf(‘\n’);

Ans. B (printf(“\n”)

 

  1. Which header file will be included to use functions like malloc()and calloc()?
    1. dos.h
    2. string.h
    3. stdlibh
    4. memory.h

                Ans. C (stdlib.h)

 

  1. What function will be used to free the memory allocated by calloc()?
    1. free( );
    2. dealloc( );
    3. malloc( )
    4. memalloc(variable_name, 0)

                                   Ans. A (free( ); )

 

  1. Which keyword will be used for coming out of recursion?
    1. Break;
    2. Exit;
    3. Return;
    4. None of these

Ans. C (return;)

 

  1. What is the invalid identifier from the below?
    1. __0__
    2. volatile
    3. DOUBLE
    4. Int

     Ans. B (volatile)

 

  1. What is the built in function to compare 2 strings?
    1. strcmp( )
    2. string_cmp( )
    3. equals( )
    4. str_compare( )

Ans. A (strcmp( ))

 

  1. Which one of the following is an invalid assignment operator?
    1. a /= 10;
    2. a %= 10;
    3. a |= 10;
    4. None of these

                                 Ans. D (None of these)

Previous Post
Next Post

Posted by- Team Alpha

अब आप Education Masters Andriod App भी डाउनलोड कर सकते हैं डाउनलोड करने के लिए लिंक पर क्लिक करें Click Here for Download

दोस्तों अगर आपको किसी भी प्रकार का सवाल है या eBook की आपको आवश्यकता है तो आप निचे comment कर सकते है. आपको किसी परीक्षा की जानकारी चाहिए या किसी भी प्रकार का हेल्प चाहिए तो आप comment में हमे बता सकते हैं हम आपको जल्दी ही reply कर देंगे। अगर आपको हमारा article पसंद आया हो तो अपने दोस्तों के साथ share करना न भूलें करे.

आप हमारे फेसबुक पेज Facebook page से भी जुड़ सकते है जिसके माध्यम से आपको Daily updates आपके फेसबुक पर मिलते रहेंगे।

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Bhai Bhut Mehnat lagi hai?