Which of the following statement is correct about the program given below? #include<iostream.h>
#include<string.h>
class CuriousTab
{
public:
void GetData(char *s, int x, int y )
{
int i = 0;
for (i = x-1; y>0; i++)
{
cout<< s[i];
y--;
}
}
};
int main()
{
CuriousTab objCuriousTab;
objCuriousTab.GetData((char*)"Welcome!", 1, 3);
return 0;
}
Correct Answer: The program will print the output Wel.
Discussion & Comments