1.

Write down the operation performed by the following statements.1. int l = strlen(“Computer Program”); 2. char ch[ ] = tolower(“My School”); 3. cout << (strcmp(“High”, “Low”)>0?toupper(“High”):tolower(“Low”));

Answer»

1. The built in function strlen find the length of the string i.e. 16 and assigns it to the variable I.

2. This is an error because to lower is a character function. 

3. This is also an error because to lower and to upper are character functions.



Discussion

No Comment Found

Related InterviewSolutions