Data Structures :: Strings

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

NA
SHSTTON
21
Solv. Corr.
85
Solv. In. Corr.
106
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.

 View Answer |  Discuss in Forum |  Workspace | Asked In CapgeminiSociete Generale |

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace

NA
SHSTTON
31
Solv. Corr.
50
Solv. In. Corr.
81
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

 View Answer |  Discuss in Forum |  Workspace | Asked In Societe Generale |

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace