Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming Quiz 103 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
#include
class IndiaBix
{
int val;
public:
void SetValue(char *str1, char *str2)
{
val = strcspn(str1, str2);
}
void ShowValue()
{
cout<< val; } }; int main() { IndiaBix objBix; objBix.SetValue((char*)"India", (char*)"Bix"); objBix.ShowValue(); return 0; }

[A].2
[B].3
[C].5
[D].8

Answer: Option B