TCS Papers: Sample Questions 197 - 198 of 502

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 197

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

Can two or more operators such as and be combined in a single line of program code

Explanation

  • Yes, it’s perfectly valid to combine operators, especially if the need arises.

  • For example: “printf (“Hello 'World'”) will output the text “Hello” on the first line and “World” enclosed in single quotes on the next two lines.

Program of Newline and tab space

Program of Newline and Tab Space

Given the example of the and be combined in a single line of program code.

Question number: 198

» Basic CS » Networks

Essay Question▾

Describe in Detail

What are the key elements of protocols?

Explanation

The key elements of a protocol are syntax, semantics and timing.

  • Syntax:

    • Syntax refers to the structure of data, meaning the order in which they are presented.

    • For example, a simple protocol might expect the first 8 bits of data to be the address of the sender, the second 8 bits to be the address of the receiver and the rest of the stream to be the message itself.

  • Semantics

    • Semantics refers to the meaning of each section of bits.

    • For example, how are a particular pattern to be interpreted? What action is to be taken based on the interpretation? Does an address identify the route to be taken or the final destination of the message?

  • Timing

    • The term timing refers to two characteristics:

      • When data should be sent?

      • How fast they can be sent?

    • For example, if a sender produces data at 100 mbps but the receiver can process data at only 1 mbps, the transmission will overload the receiver and some data will be lost. Timing would prevent this loss.