

Functions - Programming
Q1: What will be the output of the following program?
#include<iostream.h>
#include<string.h>
class AptitudeCrack
{
char txtMsg[50];
public:
AptitudeCrack(char *str = NULL)
{
if(str != NULL)
strcpy(txtMsg, str);
}
int AptitudeFunction(char ch);
};
int AptitudeCrack::AptitudeFunction(char ch)
{
static int i = 0;
if(txtMsg[i++] == ch)
return strlen((txtMsg + i)) - i;
else
return AptitudeFunction(ch);
}
int main()
{
AptitudeCrack objAptitude('Welcome to AptitudeCrack.com!');
cout<< objAptitude.AptitudeFunction('t');
return 0;
} A 6
B 8
C 9
D 15
E 16
|


For help Students Orientation
Mcqs Questions
One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.