1.

What will be the output of the following program?

#include<iostream.h>
#include<string.h> class IndiaBix
{ char str[50]; char tmp[50]; public: IndiaBix(char *s) { strcpy(str, s); } int BixFunction() { int i = 0, j = 0; while(*(str + i)) { if(*(str + i++) == ' ') *(tmp + j++) = *(str + i); } *(tmp + j) = 0; return strlen(tmp); }
};
int main()
{ char txt[] = "Welcome to IndiaBix.com!"; IndiaBix objBix(txt); cout<< objBix.BixFunction(); return 0;
}

A. 1
B. 2
C. 24
D. 25
Answer» C. 24


Discussion

No Comment Found

Related MCQs