C Multiple Choice Questions

 

  1. The output of this C code?int main()
    {
    enum {KIWI = 12, GUAVA, PINEAPPLE = 11, APPLE};
    printf(“APPLE = %d\n”, APPLE);
    }

    1. APPLE = 12
    2. APPLE = 0
    3. APPLE = 11
    4. APPLE = 2

 

Ans. a. APPLE = 12

 

  1. The output of this C code?intmain()
    {
    int a = 010;
    printf(“%d”, a);
    }

    1. 9
    2. 8
    3. 2
    4. 0

   Ans. b. 8

 

  1. C programs are converted into machine language with the help of?
    1. A compiler
    2. An Editor
    3. An operating system
    4. None of the above

 

      Ans. a. A compiler

 

  1. In a C Arithmetic Instruction which one is allowed?
    1. {}
    2. []
    3. ()
    4. None of above

 

Ans.  c ()

 

  1. What is the use of perror( ) function?
    1. prints the error message specified by the compiler
    2. Work same as printf()
    3. prints the garbage value assigned by the compiler
    4. None of the above

 

Ans, a. prints the error message specified by the compiler

 

  1. What do you mean by C Tokens?
    1. The largest individual units of program
    2. The smallest individual units of c program
    3. The basic element recognized by the compiler
    4. b & c both

 

Ans. d. b & c both

 

  1. In switch statement, each case instance value must be?
    1. Variable
    2. Special symbol
    3. Constant
    4. None of these

 

   Ans. c. Constant

 

  1. A binary tree with 27 nodes has how many null branches?
    1. 35
    2. 55
    3. 27
    4. None of above

 

Ans. d. None of above

 

  1. In which of the following is not a proper class storage?
    1. Static
    2. Extern
    3. Auto
    4. Dec

 

Ans. d. Dec

 

  1. In C Language which one is not a reserve keyword?
    1. Main
    2. Auto
    3. Case
    4. Register

 

Ans. a. Main

 

  1. What can Far pointer access?
    1. Single memory location
    2. All memory location
    3. No memory location
    4. First and Last Memory Address

 

Ans.  c. All memory location

  1. In C an uninitialized pointer is called?
    1. Destructor
    2. Constructor
    3. Pointer
    4. Wild pointer

 

Ans. d. Wild pointer

 

  1. Name the following loop which executes at least once?
    1. If
    2. For
    3. Do-while
    4. While

 

Ans. c. Do- while

 

  1. Which symbol are used to terminates every line of code in C?
    1. )
    2. }
    3. .
    4. ;

 

Ans. d. ;

  1. How can accessed the variable from another file?
    1. Via the extern specifier
    2. Via the pointer specifier
    3. Via the auto specifier
    4. Via the global specifier

 

Ans. a. via the extern specifier

  1. CONTINUE statement can’t be used with?
    1. For
    2. Switch
    3. Do
    4. While

 

Ans. b. Switch

 

  1. What will be the output of this code: -?

int main ()

{

For (i=0; i<=10; i++)

Printf(“%d”, i);

}

  1. 10
  2. 9
  3. 0
  4. None of these

 

Ans. a. 10

 

  1. What will be the output of this code: -?

int main ()

{

For (i=10; i++; i<15;)

Printf(“%d”, i);

}

  1. 10
  2. 15
  3. 20
  4. None of these

 

Ans. d. None of these

 

  1. What is called when a name having a few letters, underscore, numbers & special characters?
    1. Tokens
    2. Reserved keywords
    3. Identifier
    4. Keywords

 

Ans. c. Identifier

 

  1. Which of the following is the integer constants?
    1. Octal integer constant
    2. Hexadecimal integer constant
    3. Decimal integer constant
    4. All of the above

 

Ans. d. All of the above

182 Total Views 6 Views Today
Previous Post
Next Post

Posted by- Team Alpha


Leave a Reply

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

Close