Type Here to Get Search Results !

C Programming MCQ with Answers [ SET - 7 ] | Advanced C Programming mcq

 Advanced C Programming mcq


Advanced C Programming mcq


1. An …………..is a collection of variables of the same type. And they are declared like this:

    Arry, int height (10)
    Structure, struct height
    Enumerated, Enum height (2)

ANSWER= (A) Arry, int height (10)

 

2. In C++ Overloading is otherwise called as

    virtual polymorphism
     transient polymorphism
    pseudo polymorphism
ANSWER= (D) ad –hoc polymorphism

 

3. Find the output of the program: 

main()

{

printf("%d", (8,4));

} int f(int a, int b) 

{

if (a= b)

return a;

else if (a>b)

return f(a-b, b);

else

return f(a, b-a);

}





ANSWER= (B) 4

 

4. What will be output if you will compile and execute the following c code?

int extern x;

void main()

printf(“%d”,x);

x=2;

getch();

}

int x=23;




ANSWER= (C) 23

 

5. Which of the following are tokens in C ?

    Keywords
    Variables
    Constants
ANSWER= (D) All of the above

 

6. Find the output of the following programs:

main ()

(printf("%d", { (8, 4)), }

 int f(int a, int b) (if (a = = b) return a; else if (a > b) 

return 

f(a, b-a);

return f(ab, b); else




ANSWER= (B) 4

 

7. What is the control character for “a single character”.

     %c
     %d
     %i
ANSWER= (A) %c

 

8. What is the control character for “a decimal integer”.

     %c
    %d
    %i

ANSWER= (B) %d

 

9. C programs are converted into machine language with the help of

     An Editor
    A compiler
    An operating system
ANSWER= (B)  A Compiler

 

10. Which escape character can be used to begin a new line in C ?

     \a
    \b
    \m
ANSWER= (D) \n

 

11. A C variable cannot start with

    An alphabet
    A number
    A special symbol other than underscore
ANSWER= (D) both (b) and (c)

 

12. Which escape character can be used to begin a new line in C?

     \a



ANSWER= (D) \n

 

13. Which of the following is allowed in a C Arithmetic instruction

    []
    {}

ANSWER= (C) ()

 

14. Which of the following shows the correct hierarchy of arithmetic operations in C

    / + * –
    * – / +
    + – / *
ANSWER= (D) * / + –

 

15.  If P and Q are properly declared and initialized pointers and x, y and z. are integer variables, then which of the following statement is not valid?


     x=x+*P 
     y=*P+*Q
     P=Q+10 
ANSWER= (D) *P=P+10

 

16. Array passed as argument to a function 

     Address of the array 
    value of the first eliment of the array 
    Address of the first eliment of the array
ANSWER= (C) Address of the first eliment of the array

 

17. The worst case time complexity of AVL tree is better in comparison to binary search tree for

     Search and Insert Operations
    Search and Delete Operations
    Insert and Delete Operations
ANSWER= (D) Search, Insert and Delete Operations

 

18. What are the new features of C11 or ISO IEC 9899 2011 standard.?

    Type generic Macros, Static Assertions
    Multi Threading, Anonymous Unions, quick_exit
    Bounds Checking Interfaces, Anonymous Strurctures

ANSWER= (D) All

 

19. C language was invented in which laboratories.?

    Uniliver Labs
    IBM Labs
    AT&T Bell Labs
ANSWER= (C) AT&T Bell Labs

 

20.  When we mention the prototype of a function?

    Defining 
    Declaring
    Prototyping
ANSWER= (B) Declaring

 

21. How would you round off a value from 1.66 to 2.0? 

    ceil(1.66) 
    floor(1.66) 
    roundup(1.66)

ANSWER= (A) ceil(1.66) 

 

22. BCPL Language is also called..?

    C Language
    B Language
    D Language
ANSWER= (D) None

 

23.  Which of the following operation produce an 1, If the input bits are 1 and 1?

    or
    and
    exclusive or
ANSWER= (A) a,b, c)

 

24. If the word size is 16 bit then ~0 x c5 will be

    0 x 3a
    0xff3a
     0x5c
ANSWER= (B) 0xff3a

 

25. The following statement P r I n t f ( ‘’ % f’’, 9/5); Prints




ANSWER= (D)  none of the above

 

26. The function abort() is declared in the header file

    <math.h>
    <iostream.h>
    <stdio.h>
ANSWER= (B) <iostream.h>

 

27.  Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

    rem = 3.14%2.1;
    rem=modf(3.14, 2.1);
    rem = fmod(3.14, 2.1); 
ANSWER= (C) rem = fmod(3.14, 2.1); 

 

28. If PI and P2 are properly declared and initialized pointers and x,y,z are integer variables, then which of the following statement is not valid? 

     x = x+P1 
    y = P1 *P2
    Z= Z-P2/*P1 
ANSWER= (C) Z= Z-P2/*P1 

 

29.  Which of the following shows the correct hierarchy of arithmetic operations in C

     / + * -
    * - / +
    + - / *
ANSWER= (D) * / + -

 

30. What is an array?

    an array is a collection of variables that are of the dissimilar data type.
    an array is a collection of variables that are of the same data type.
    an array is not a collection of variables that are of the same data type.
ANSWER= (B) an array is a collection of variables that are of the same data type.





Friends if you like this post,kindly comment bellow and do share your responce.Thank You for Visiting.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Below Post Ad