Solved MCQ of C set-1


1. C language has been developed by
A) Martin Richards
B) Bijarne Stroustrup
C) Dennis Ritche
D) Ken Thompson

2. int[ ] ={5,6,7,8,9} What is the value of a[3]?
A) 9
B) 8
C) 7
D) 6


3. C can be used on
A) Only MS-Dos operating System
B) Only Linux operating system
C) Only Windows operating system
D) All of the above


4. Float a[15], what is the size of array?
A) 17
B) 14
C) 15
D) 16

5. C programs are converted into machine language with the help of
A) An Editor
B) A complier
C) An operating system
D) None of the above

6. Array is
A) Primary data type
B) Pointer data type
C) Heterogeneous data type
D) Homogenous data type

7. Which of the following is allowed in a C Arithmetic Instruction?
A) [ ]
B) { }
C) ( )
D) None of the above

8. To accept 100 different values into the array we require
A) Loop
B) If condition
C) Function
D) Structure

9. If a is an integer variable, a=7/3; will return a value
A) 2.5
B) 3
C) 0
D) 2

10. Pointer holds
A) Value of variable
B) Address of variable
C) Value and address of variable
D) Always null

Answers:
1. C) Dennis Ritche
2. B) 8
3. D) All of the above
4. C) 15
5. B) A complier
6. D) Homogenous data type
7. C) ( )
8. A) Loop
9. D) 2
10. B) Address of variable

You Might also view the following Related Posts

Solved MCQ of Basic of IT Set-1


1. Binary code "0" means ............
A) State of absence
B) State of presence
C) State of Negative
D) State of Positive

2. ............. is compulsory part of HTML.
A) <br>
B) <body>
C) <tr>
D) <img>

3. CAI stands for ................
A) Computer Aided Instruction
B) Computer Aided information
C) Cost Added Information
D) Computer Aided Infrastructure

4. Maximum font size in HTML is ...........
A) 6
B) 7
C) 5
D) 8

5. MICR reader is an ............... device.
A) Input
B) Output
C) Electric
D) Storage

6. Internet is .................
A) Network of Networks
B) Networks of Communication
C) Networks of Data
D) Group of LAN

7. ................. is a standalone tag.
A) <img>
B) <body>
C) <head>
D) <p>

8. FTP stands for
A) Folder Transfer Protocol
B) File Transfer Process
C) File Transfer Protocol
D) File Text Protocol

9. Hexadecimal number system has ..............base.
A) 16
B) 14
C) 12
D) 08

10. HTML stands for
A) Hypertext Mass up language
B) Hypertext Markup language
C) Hypertext Move up language
D) Hypertext Mark of language

Answers: 
1. A) State of absence
2. B) <body>
3. B) Computer Aided information
4. B) 7
5. A) Input  
6. A) Network of Networks
7. A) <img>
8. C) File Transfer Protocol
9. A) 16
10.B) Hypertext Markup language 

Solved MCQ of Java Set-1


1. Java programs are
A) Faster than others
B) Platform independent
C) Not reusable
D) Not scalable

2. Java has its origin in
A) C programming language
B) PERRL
C) COBOL
D) Oak programming language


3. Which one of the following is true for Java
A) Java is object oriented and interpreted
B) Java is efficient and faster than C
C) Java is the choice of everyone.
D) Java is not robust.


4. The command javac is used to
A) debug a java program
B) compile a java program
C) interpret a java program
D) execute a java program

5. Java servlets are an efficient and powerful solution for creating ………….. for the web.
A) Dynamic content
B) Static content
C) Hardware
D) Both a and b

6. Filters were officially introduced in the Servlet ……………… specification.
A) 2.1
B) 2.3
C) 2.2
D) 2.4

7. Which is the root class of all AWT events
A) java.awt.ActionEvent              
B) java.awt.AWTEvent
C) java.awt.event.AWTEvent
D) java.awt.event.Event

8. OOP features are
i) Increasing productivity                              ii) Reusability
iii) Decreasing maintenance cost               iv) High vulnerability
A) 1,2 & 4
B) 1,2 & 3
C) 1, 2 & 4
D) none of the above

9. break statement is used to
i) get out of method                                       ii) end aprogram
iii) get out of a loop                                         iv) get out of the system
A) 1 & 2
B) 1,2 & 3
C) 1 & 3
D) 3

10. Native – protocol pure Java converts ……….. into the ………… used by DBMSs directly.
A) JDBC calls, network protocol
B) ODBC class, network protocol
C) ODBC class, user call
D) JDBC calls, user call

Answers:
1. B) Platform independent
2. D) Oak programming language
3. A) Java is object ...... interpreted
4. B) compile a java program
5. A) Dynamic content
6. B) 2.3
7. B) java.awt.AWTEvent
8. B) 1,2 & 3
9. D) 3
10. A) JDBC calls, ......protocol

MCQ of C++ with answer Set-2


1. The ……………. Operator is known as insertion operator.
A) >>
B) >
C) <<
D) <

2. State True or False.
i) A satic function can have access to only other static members (functions or variables) declared in the same class.
ii) A static member function can be called using the class name (instead of its objects)
A) True, True
B) True, False
C) False, True
D) False, False

3. Which of the following condition is true for an object used as a function argument?
i) A copy of the entire objects is passed to the function.
ii) Only the address of the object is transferred to the function.
A) Only i
B) Only ii
C) Both i and ii
D) None of them


4. …………… enable us to hide, inside the object, both the data fields and the methods that act on that data.
A) Encapsulation
B) Polymorphism
C) Inheritance
D) Overloading

5. Which of the following is/ are the characteristics of friend function.
A) It is not in the scope of the class to which it has been declared as friend.
B) It can invoke like a normal function without the help of any object.
C) Usually, it has the objects as arguments.
D) All of the above.

6. The dereferencing operator ………….. is used to access a member when we use pointers to both the object and the member.
A) ->*
B) .*
C) Any of the above
D) None of the above

7. A ………………. Is a class whose instances themselves are classes.
A) Subclass
B) Abstract Class
C) Meta Class
D) Object Class

8. The dereferencing operator ……… is used when the object itself is used width in the member pointer.
A) ->*
B) .*
C) Any of the above
D) None of the above

9. A constructor that accepts no parameters is called the ……………….
A) Paramless constructor
B) No parameter constructor
C) Default constructor
D) Argumentless constructor

10. Automatic initialization of object is carried out using a special member function called …………
A) Friend
B) Casting
C) Reference Parameter
D) Constructor

11. Which of the following characteristics of constructor are true.
i) They should be declared in the public section.
ii) They are invoked automatically when the objects are created.
iii) They do not have return type and void also.
iv) We cannot refer their address.
v) Constructors cannot virtual.
A) Only i, ii, iii and v
B) Only ii, iii, iv, and v
C) Only i, iii, iv and v
D) All i, ii, iii, iv and v

12. A ……………. takes a reference to an object of the same class as itself as an argument.
A) Reference constructor
B) Copy Constructor
C) Self Constructor
D) None of the above

13. State True or False
i) A destructor never takes any argument nor does it return any value.
ii) It releases memory space for future use.
A) True, True
B) True, False
C) False, True
D) False, False

14. Which of the following operates cannot be overloaded?
i) Size of operator (sizeof)            ii) Scope resolution Operator
iii) Conditional operator (?:)        iv) Assignment Operator (=)
A) i, ii, iii only
B) ii, iii, iv only
C) i, iii, iv only
D) all i, ii, iii, iv

15. …………. Is the process of creating new classes, called derived classes from existing classes called base class.
A) Inheritance
B) Encapsulation
C) Polymorphism
D) Overloading

16. State True or False.
i) While overloading operators new operator can be overloaded.
ii) The binary operator such as +, -, * and must explicitly return a value.
A) True, True
B) True, False
C) False, True
D) False, False

17. ………… function writes a string of text to a window.
A) cputs ()
B) put ()
C) gets ()
D) tputs ()

18. Which of the following condition (s) should satisfy the casting operator.
i) It must be a class member.
ii) It must not satisfy a return type.
iii) It must have any arguments.
iv) All of the above.

19. Find the Hierarchy of Data Types.
i) Long double   ii) Double             iii) Float                                iv) Long                                v) Int         vi) Char
A) 1-2-3-4-5-6
B) 1-3-2-4-5-6
C) 1-2-3-5-4-6
D) 1-2-4-3-5-6

20. ………….. function sets the fill pattern and color.
A) floodfill ()
B) setcolor()
C) setfillstyle()
D) fillstyle ()

 Answers:
1.       C) <<
2.       B) True, False
3.       C) Both i and ii
4.       A) Encapsulation
5.       D) All of the above.
6.       A) ->*
7.       C) Meta Class
8.       B) .*
9.       C) Default constructor
10.   D) Constructor
11.   D) All i, ii, iii, iv and v
12.   B) Copy Constructor
13.   A) True, True
14.   A) i, ii, iii only
15.   A) Inheritance
16.   C) False, True
17.   A) cputs ()
18.   iv) All of the above.
19.   A) 1-2-3-4-5-6
20.   C) setfillstyle()


You might also view the following related posts
For other more posts: Click Here

Solved MCQ of C++ Set-1


1. C++ is an extension of C with a major addition of the class construct feature of ……………..
A) Simula67
B) Simula57
C) Simula47
D) Simula87

2. C++ has the name ………………….. before it was changed to C++.
A) Improved C  
B) Integrated C
C) C with classes
D) C with Simula

3. …………. Refer to the names of variables, functions, arrays, classes etc. created by the programmer.
A) Keywords
B) Identifiers
C) Constraints
D) Strings

4. In C++, the keyword void was used ………..
A) To specify the return type of function when it is not returning any value.
B) To indicate an empty argument list to a function.
C) To declare the generic pointers.
D) All of the above.

5. Match the following
a) : :                                       i) Pointer to member declarator
b) : :*                                    ii) Pointer to member operator
c) ->*                                    iii) Scope resolution operator
A) a-ii, b-iii, c-i
B) a-iii, b-i, c-ii
C) a-i b-ii, c-iii
D) a-iii, b-ii, c-i

6. If m and n are int type variables, what will be the result of the expression
m% n     when m=5 and n=2 ?
A) 0
B) 1
C) 2
D) None of the above

 7. Some of the C++ operators cannot overloaded which are
i) Member access operators (. And .*)                   ii) Conditional operator (? :)
iii) Scope resolution operator (: :)                             iv) Size operator (sizeof)
A) only i, ii and iii
B) only ii, iii and iv
C) only ii and iv
D) All i, ii, iii and iv

8. Some of the situations where inline expansion may not work are:
A) For functions returning values, if a loop, a switch or goto exists.
B) If functions contain static variables and they are re-cursive.
C) For functions not returning values, if return statement exist.
D) All of the above.

9. Which of the following control expressions are valid for an if statement?
A) an integer expression
B) a Boolean expression
C) either A or B
D) Neither A nor B

10. …………… is a way to bind the data and its associated functions together which allows the data and functions to be hidden.
A) Structure
B) Class
C) Enum
D) Both A and B

Answers

1. A) Simula67
2.   C) C with classes
3.   B) Identifiers
4.  D) All of the above.
5.   B) ii-False, ii-True
6.   B) 1
7.  D) All i, ii, iii and iv
8.  D) All of the above.
9.   B) a Boolean expression
10.  B) Class