a) reverse() method reverses all characters
b) reverseall() method reverses all characters
c) replace() method replaces first occurrence of a character in invoking string with another character
d) replace() method replaces last occurrence of a character in invoking string with another character
Answer: a
Explanation: reverse() method reverses all characters. It returns the reversed object on which it was called.
Related Posts
The #elif directive cannot appear after the preprocessor #else directive.
Conditional inclusion can be used for ___________
In a conditional inclusion, if the condition that comes after the if is true, then what will happen during compilation?
What will be the output of the following C code?
#include < stdio.h >
#define COLD
int main()
{
#ifdef COLD
printf(“COLD\t”);
#undef COLD
#endif
#ifdef COLD
printf(“HOT\t”);
#endif
}The “else if” in conditional inclusion is written by?
What will be the output of the following C code?
#include < stdio.h >
#define SYSTEM 20
int main()
{
int a = 20;
#if SYSTEM == a
printf(“HELLO “);
#endif
#if SYSTEM == 20
printf(“WORLD\n”);
#endif
}What is the advantage of #define over const?
Join The Discussion