# TCS Placement: Sample Questions 276 - 278 of 502

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

## Question 276

Edit

### Write in Short

How do you find out if a linked-list has an end (i.e.. the list is not a cycle)

### Explanation

• You can find out by using 2 pointers.
• One of them goes 2 nodes each time.
• The second one goes at 1 node every time.
• If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower.

## Question 277

### Question

MCQ▾

A person had to multiply two numbers. Instead of multiplying by 35, he multiplied by 53 and the product went up by 540. What was the raised product?

Choice (4)

a.

1040

b.

1720

c.

780

d.

1590

d.

### Explanation

• Let two numbers be x and 35.
• Instead of multiplying the number x by 35, person multiplies it with 53.
• Result of this mistake is that product is raised by 540.
• Writing in equation form,

• The product will be

## Question 278

### Question

MCQ▾

Which of the following is the correct class of the object cout?

Choice (4)

a.

Ostream

b.

Iostream

c.

Ifstream

d.

Istream