Wednesday, January 26, 2022
Friday, January 21, 2022
Thursday, February 25, 2021
MCQ Control Statements in C++
7:20 AM
No comments
1. How many loops are there in C++
(A) 2
(B) 3
(C) 4
(D) 1
Ans: B
2. What is correct syntax of for loop?
(A) for(initialization;condition;increment/decrement) { }
(B) for(increment/decrement;initialization;condition) { }
(C) for(initialization,condition,increment/decrement { }
(D) None of These
Ans: A
3. Can a for loop contain another for loop?
(A) No
(B) Yes
(C) CompilationError
(D) Runtime Error
Ans: B (Explanation Nested for loop)
4. What is size of void data types in C++?
(A) 2Bytes
(B) 4Bytes
(C) Undefined
(D) 0
Ans: D
5. Which one is NOT a looping statement:
(A) For
(B) Do…While
(C) If
(D) While
Ans: C
6. A process of repeating the body statements is called ...
(A) Branching
(B) Looping
(C) Flowcharting
(D) Algorithm
Ans: B
7. How many times GGSSS Badshahpur is printed?
int main()
{
int i=0;
if(i< = 5)
{
cout<<" GGSSS Badshahpur ";
i++;
}
return 0;
}
(A) Error
(B) 5times
(C) 4times
(D) 6 times
Ans: Try Yourself
8. Loops in C++ Language are implemented using.?
A) While Block
B) For Block
C) Do While Block
D) All the above
Ans D
9. Choose correct C++ while loop syntax.
A)
while(condition)
{
//statements
}
B)
{
//statements
}while(condition)
C)
while(condition);
{
//statements
}
D)
while()
{
if(condition)
{
//statements
}
}
Answer A
10. What is the output of C++ Program segment.? If condition is true
while(condition)
{
cout<<"JAI HIND";
break;
}
A) JAI HIND
B) JAI HIND is printed unlimited number of times.
C) No output
D) Compiler error.
Ans A
Monday, February 22, 2021
Wednesday, February 17, 2021
Control Statements C++ MCQ
9:06 AM
No comments
1. Which of the following is the scope resolution operator in C++.
A) : :
B) : : *
C) _>*
D) . *
ANS A ::
2. . …………….. operator can be used to uncover a hidden variable.
A) pointer-to-member
B) memory release
C) scope resolution
D) line feed
ANS C
3. ……………………. produce results of type bool which takes a value true or false.
A) Relational expressions
B) Float expressions
C) Logical expressions
D) Bitwise expressions
ANS A
4. The ………………… is an entry-enrolled loop.
A)while
B)IF
C)do-while
D) switch
ANS A
5. The ………………….. is an exit-enrolled loop.
A)while
B)for
C) do-while
ANS C
6. The operator ………………… is known as a compound assignment or short-hand assignment operator.
A) =
B) = =
C) += =
D) +=
ANS D +=
7. The switch statement is also called as?
• A. choosing structure
• B. selective structure
• C. certain structure
• D. none of the mentioned
ANS B
8. The if..else statement can be replaced by which operator?
• A. Bitwise operator
• B. Conditional operator
• C. Multiplicative operator
• D. none of the mentioned
ANS B
9. The destination statement for the goto label is identified by what label?
• A. $
• B. @
• C. *
• D. :
ANS D :
10. How many types of loops are there?
• A. 4
• B. 2
• C. 3
• D. 1
ANS C 3
11. Which looping process is best used when the number of iterations is known?
• A. for
• B. while
• C. do-while
• D. all looping processes require that the iterations be known
ANS A for
12. This operator ? : is known as
• A. conditional
• B. relational
• C. casting operator
• D. none of the mentioned
ANS A
13. ++X is an example of
Post increment
Pre increment
Post decrement
Pre decrement
ANS Pre increment
14. The CONDITIONAL OPERATOR in C++ is a
Unary operator
Binary operator
Ternary operator
ANS Ternary operator
15. The continue statement cannot be used with
A. for
B. while
C. do while
D. switch
Ans : D
Explanation: continue is used to skip the statments and can not be used with switch
16. Switch statement accepts.
A. int
B. char
C. long
D. All of the above
Ans : D
Explanation: switch statment accepts all int , char and long .
17. Which loop is guaranteed to execute at least one time.
A. for
B. while
C. do while
D. None of the above
Ans : C
Explanation: In do while first the statements in the body are executed then the condition is checked. If the condition is true then once again statements in the body of do while are executed.
18. do-while loop terminates when conditional expression returns?
A. One/True
B. Zero/False
C. None of the above
Ans : B
Explanation: zero indicate False which terminate the loop .
19. In the context of "break" and "continue" statements in C++
ANS
"break" and "continue" can be used in "for", "while" and "do-while" loop body. But only "break" can be used in "switch" body.
Monday, February 15, 2021
Computer network MCQ
8:03 AM
No comments
1. A collection of hyperlinked documents on the internet forms the ?.?
World Wide Web (WWW)
E-mail system
Mailing list
Hypertext markup language
Answer: (a) World Wide Web (WWW)
Explanation: World Wide Web (WWW) creates a collection of hyperlinked documents on the Internet.
2. The location of a resource on the internet is given by its?
Protocol
URL
E-mail address
ICQ
Ans URL
3. Which software prevents the external access to a system?
Firewall
Gateway
Router
Virus checker
Answer: Firewall
Explanation: A firewall is a network securing software that prevents unauthorized users and dangerous elements from accessing the network. Software firewall acts as a filter for our network which prevents harmful information.
4. Which one of the following is a valid email address?
javat@point.com
gmail.com
tpoint@.com
javatpoint@books
Ans javat@point.com
5.When the mail server sends mail to other mail servers it becomes ___ ?
SMTP client
SMTP server
Peer
Master
Answer: SMTP client
Explanation: The SMTP client is an organization that allows sending emails using the SMTP server. SMTP servers can't send emails to other SMTP servers separately. It is based on client-server architecture.
6. Which of the following device is used to connect two systems, especially if the systems use different protocols?
A. Repeater
B. Gateway
C. Bridge
D. Hub
Ans B
7. Which of the following communications modes support two-way traffic but in only one direction of a time?
A. Simplex
B. Half-duplex
C. Three-quarters duplex
D. Full duplex
Ans B
8. A MODEM is connected in between a telephone line and a
A. Computer
B. Communication Adapter
C. Serial Port
D. Network
Ans A
9. Bluetooth is an example of
A. Personal area network
B. Local area network
C. Virtual private network
D. Wide area network
Ans A
10. A ____ is a set of rules.
A. Resource locator
B. Protocol
C. Domain
D. URL
Ans B
11. A ____ typically connects personal computers within a very limited geographical area, usually within a single building.
A. LAN
B. WAN
C. MAN
D. TAN
Ans A
12. The vast network of computers that connects millions of people all over the world is called
A. LAN
B. Web
C. Hybertext
D. Internet
Ans D
13. To connect networks of similar protocols ______ are used.
A. Routers
B. Bridges
C. Gateways
D. Dial-up routers
Ans B
14. Computers connected to a LAN (local area network) can
A. Run faster
B. Go on line
C. E–mail
D. Share information and/or share peripheral equipment
And D
15. A collection of computers and devices connected together via communication devices and transmission media is called a
A. Workgroup
B. Server
C. Mainframe
D. Network
And D
Control Statements in C++ MCQ
4:25 AM
No comments
Control Flow Statements
1. Which of the following can replace a simple if-else construct?
(A) Ternary operator (B) while loop (C) do-while loop (D) for loop
2. Which of the following is an entry-controlled loop?
(A) do-while loop (B) while loop (C) for loop (D) Both (B) and (C)
3. Which of the following is most suitable for a menu-driven program?
(A) do-while loop (B) while loop (C) for loop (D) All of these
4. Consider the following loop :
for(int i=0; i<5; i++) ;
What will be the value of i after this loop?
(A) It will give compilation error. (B) 5 (C) 6 (D) Some Garbage value
5. A switch construct can be used with which of the following types of variable?
(A) int (B) int, char (C) int, float, char (D) Any basic datatype
6. Which of the following must be present in switch construct?
(A) Expression in ( ) after switch (B) default
(C) case followed by value (D) All of these
7. What is the effect of writing a break statement inside a loop?
(A) It cancels remaining iterations. (B) It skips a particular iteration.
(C) The program terminates immediately. (D) Loop counter is reset.
8. What is the effect of writing a continue statement inside a loop?
(A) It cancels remaining iterations.
(B) It skips execution of statements which are written below it.
(C) The program terminates immediately.
(D) Loop counter is reset.
9. If the variable count exceeds 100, a single statement that prints “Too
many” is
(A) if (count<100) cout << “Too many”;
(B) if (count>100) cout >> “Too many”;
(C) if (count>100) cout << “Too many”;
(D) None of these.
10. The break statement causes an exit
(A) from the innermost loop only. (B) only from the innermost switch.
(C) from all loops & switches. (D) from the innermost loop or switch.
11. for (; ;)
(A) means the test which is done using some expression is always true
(B) is not valid
(C) will loop forever
12. Consider the following statements:
int x = 22,y=15;
x = (x>y) ? (x+y) : (x-y);
What will be the value of x after executing these statements?
(A) 22 (B) 37 (C) 7 (D) Error. Cannot be executed
ANS: 1. A 2. D 3. A 4. B 5. B 6. A 7. A 8. B
9. C 10. D 11. C 12. B
13. Which keyword can be used for coming out of recursion?
A. break B. return C. exit D.
Both (a) and (b)
Ans B return
14. The keyword ‘break’ cannot be simply used within:
A. do-while B. if-else C. for D. while
Ans B if-else
15. Which keyword is used to come out of a loop only for that iteration?
A. break B. continue C. return D. None of the mentioned
Ans B continue
Saturday, February 13, 2021
Computer Networks OSI Reference Model MCQ
4:53 AM
No comments
1.) The acronym OSI stands for ____ in computer networking.
A) Organization for Standards Institute
B) Open Systems Interconnection
C) Organizing Systems Interconnection
D) Open Systems Interworking
Answer[=]
B
Explanation:
OSI refers to Open Systems for Interconnection.
2) Who developed standards for the OSI reference model?
A) ANSI - American National Standards Institute
B) ISO - International Standards Organization
C) IEEE - Institute of Electrical and Electronics Engineers
D) ACM - Association for Computing Machinery
Answer[=]
B
Explanation:
Yes. It is ISO (International Standards Organization) that developed standards for operating OSI model layers in the year 1984.
3) How many layers are there in the OSI reference model of networking?
A) 5
B) 6
C) 7
D) 8
Answer[=]
C
Explanation:
7 Layers in total.
4) Each layer of the OSI model receives services or data from a ___ layer.
A) below layer
B) above layer
C) -
D) -
Answer[=]
A
Explanation:
Layers receive data or services from the below layers.
5) In the OSI model, each layer gives services or data to the __ layer.
A) below
B) above
C) -
D) -
Answer[=]
B
Explanation:
In other words, the upper layers always receive services or data from the below layers.
6) A layer of the OSI model on one system communicates with the ___ layer of its peer system.
A) above
B) below
C) same
D) None
Answer[=]
C
Explanation:
So, any given OSI layer can communicate with the same layer of its peer node.
7) Choose the correct layer numbers and names of the OSI model below.
A) Layer 7 - Application Layer, Layer 6 - Presentation Layer
B) Layer 5 - Session Layer, Layer 4 - Transport Layer
C) Layer 3 - Network Layer, Layer 2 - Data Link Layer, Layer 1 - Physical Layer
D) All the above.
Answer[=]
D
Explanation:
The matching order is as follows. Layer 7 = Application Layer, Layer 6 = Presentation Layer, Layer 5 = Session Layer, Layer 4 = Transport Layer, Layer 3 = Network Layer, Layer 2 = Data Link Layer, Layer 1 = Physical Layer.
8) In an OSI model, the lowest layer is the ___ layer.
A) Application Layer
B) Physical Layer
C) Presentation Layer
D) Data Link Layer
Answer[=]
B
Explanation:
Yes, the Physical layer is the lowest.
9) In the OSI model, which is the highest layer?
A) Application Layer
B) Physical Layer
C) Presentation Layer
D) Network Layer
Answer[=]
A
Explanation:
Yes, the Application Layer or Layer-7 is the highest layer.
10) In the OSI model, the bottom 3 layers assist in ___.
A) converting data
B) transporting data
C) -
D) -
Answer[=]
B
Explanation:
It is because of the bottom 3 layers of OSI, the data gets transferred from one node to another through the network.
11) What are the advantages of 7 layers of OSI model?
A) Troubleshooting the network is easy.
B) Developing new functions or services for a particular layer is easy.
C) Developing hardware devices targetting certain layers is easy because the services to be offered are fixed.
D) All the above
Answer[=]
D
12) A set of standards that define how to communicate with each layer of the OSI model are ___.
A) functions
B) protocols
C) data formats
D) All the above.
Answer[=]
D
13) The layer that transmits data in the form of bit streams using electrical and mechanical systems is ___ in the OSI model.
A) Physical layer
B) Data Link Layer
C) Network Layer
D) Transport Layer
Answer[=]
A
Explanation:
Physical Layer
14) The physical layer involves ___
A) Optical, electrical and mechanical properties
B) Voltage levels, timing and frequency
C) Physical connections
D) All the above
Answer[=]
D
15) The transmission media like ___ are part of the Physical layer of OSI model.
A) Copper cables
B) OFC - Optical Fiber Cables
C) RF - Radio Frequency waves including Microwaves
D) All the above
Answer[=]
D
16) An ethernet cable is part of __ layer in the OSI model.
A) Physical layer
B) Data Link Layer
C) Network Layer
D) Transport Layer
Answer[=]
A
17) The protocols working in the physical layer of the OSI Model are ___.
A) USB, Bluetooth, IEEE 802.3, IEEE 802.11, IEEE 802.15, IEEE 802.16
B) POTS, PDH, SONET, SDH, PON, OTN, DSL, ITU-T V series, ITU-T G.hn PHY
C) I.430, I.431, EIA/TIA-232, EIA/TIA-449
D) All the above
Answer[=]
D
Explanation:
All the above protocols are worth remembering for competitive exams.
18) Which is the layer of the OSI reference model that employs Error Detection?
A) Physical Layer
B) Data Link Layer
C) Network Layer
D) Session Layer
Answer[=]
B
Explanation:
Data Link Layer
19) Which is the layer that converts Packets to Frames and Frames to Packets in the OSI model?
A) Physical Layer
B) Data Link Layer
C) Network Layer
D) Transport Layer
Answer[=]
C
Explanation:
Network Layer
20) Which is the layer that converts Raw Bits to Frames and Frames to Raw Bits in the OSI model?
A) Physical Layer
B) Data Link Layer
C) Network Layer
D) Transport Layer
Answer[=]
B
Explanation:
Data Link Layer
Computer Networking Basics MCQ
4:45 AM
1 comment
1) A Computer network consists of __ number of computers or servers or systems.
A) 2
B) 3
C) more than 2
D) all
Answer[=]
D
2) A computer network may contain __.
A) Computers
B) Printers
C) Intelligent devices capable of receiving and sending data
D) All the above
Answer[=]
D
3) The purpose of a computer network is ___.
A) Sharing information or files or applications
B) Sharing of resources like printers, scanners
C) Monitoring and controlling of devices in the network from a central location
D) All the above
Answer[=]
D
4) The types of communication media used to connect different computers of a network are ___.
A) Physical wires
B) Wireless media like RF (Radio Frequency) devices
C) Both A and B
D) None
Answer[=]
C
5) The categories of a Computer network based on the area of coverage are __.
A) LAN (Local Area Network)
B) MAN (Metropolitan Area Network)
C) WAN (Wide Area Network)
D) All the above
Answer[=]
D
6) The computer networks classified based on the functionality are ___.
A) Client Server
B) Peer to Peer
C) Both Client-Server and Peer-to-Peer
D) None
Answer[=]
C
7) In a peer to peer computer networking architecture, each computer acts as a ___.
A) Server
B) Client
C) Both server and client depending the need
D) All
Answer[=]
D
8) In a Peer to Peer network architecture, all computers have equal priority. State TRUE/FALSE.
A) TRUE
B) FALSE
C) -
D) -
Answer[=]
A
9) In a peer to peer network, who controls the devices?
A) First computer
B) Last computer
C) No device controls
D) All devices control
Answer[=]
C
10) Advantages of a Peer to Peer computer network are __.
A) Easy maintenance
B) Cost effective
C) Easy to setup
D) All the above
Answer[=]
D
11) Disadvantages of a Peer to Peer computer network are __.
A) Any one tamper data
B) Less secure
C) Difficult to maintain large data as any one can modify or delete
D) All the above
Answer[=]
D
12) A server is a ___ that controls a number of computers and also has full control over the network.
A) Printer
B) Switch
C) Hub
D) Computer with a special software
Answer[=]
D
13) In a Client-Server computer network or architecture, all nodes can __ data.
A) send
B) receive
C) send and receive
D) None
Answer[=]
C
14) Which network is highly secure between a Peer-to-Peer or a Client-Server?
A) Peer-to-Peer
B) Client-Server
C) -
D) -
Answer[=]
B
15) In a Client-Server network architecture, the main data or files are stored on the __.
A) Individual PCs
B) Any PC
C) Server PC
D) Floppy
Answer[=]
C
16) Choose the correct statements about a Client-Server networking model.
A) Server software is costly to acquire and renew
B) Dedicated admin people are required to monitor and grant resources to normal computers or nodes. So this client-server network is highly secure.
C) The hardware of a Server PC is costly
D) All the above
Answer[=]
D
17) Which is the computer network that covers a small area like a room, building or a campus?
A) LAN ( Local Area Network )
B) WAN ( Wide Area Network )
C) MAN ( Metropolitan Area Network )
D) All the above
Answer[=]
A
18) Which is the network that can cover an entire city?
A) LAN
B) MAN
C) WAN
D) All
Answer[=]
B
Explanation:
Cable TV networks span over an entire city. Those use Metropolitan Area Networks.
19) Which is the network that covers large geographical area like more than one city?
A) LAN
B) MAN
C) WAN
D) None
Answer[=]
C
Explanation:
Yes. WAN - Wide Area Network covers a number of cities.
20) Which network is bigger between a MAN and WAN?
A) WAN
B) MAN
C) -
D) -
Answer[=]
A
21. The term HTTP stands for? *
22. Which one of the following is the most common internet protocol? *
23. The term FTP stands for? *
24. Which one of the following is not a network topology?
25. The term WAN stands for *
26. A term that refers to the way in which the nodes of a network are linked together. *
27.The term LAN stands for? *
28. Bus is a type of topology. *
29. A network comprising o multiple topologies.
30. The participating computers in a network are referred to as: *
31. Which network topology requires a central controller or hub? *
32. _______ topology requires a multipoint connection. *
33. Data communication system spanning states, countries, or the whole world is ________ *
34. Data communication system within a building or campus is________ *
35. WAN stands for __________ *