Data Structures :: Strings

Home > Technical Aptitude > Data Structures > Strings > General Questions

NA
SHSTTON
7
Solv. Corr.
34
Solv. In. Corr.
41
Attempted
0 M:0 S
Avg. Time

1 / 2

What is the following code segment doing?
void fn( ){
char c;
cin.get(c);                   
if (c != '\n') {
fn( );
cout.put(c);
}
}

AThe string entered is printed as it is

BThe string entered is printed in reverse order.

CIt will go in an infinite loop.

DIt will print an empty line.

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
17
Solv. Corr.
26
Solv. In. Corr.
43
Attempted
0 M:0 S
Avg. Time

2 / 2

Choose the correct option.

Which of the following statement is false ?


AArrays are dense lists and static data structure

BData elements in linked list need not be stored in adjacent space in memory

CPointers store the next data element of a list

DLinked lists are collection of the nodes that contain information part and next pointer

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace