design a black box test suite for a program that accepts
two strings and checks if the first string is a substring
of the second string and displays the number of times the
first string occurs in the second string.



design a black box test suite for a program that accepts two strings and checks if the first strin..

Answer / bhupndra

#include<stdio.h>
#include<conio.h>

int main()
{

int i=0,j=0,k=0,count=0,l=0,k1=0;
char a[80],b[80];

clrscr();
printf("\nEnter main string:-\n");
gets(a);
printf("\nEnter sub-string:-\n");
gets(b);

l=strlen(b);

while (a[i]!=EOF)
{
if (a[i]==b[j])
{
i++;
j++;
k1=1;

if (j==l)
{
j=0;
k=1;
count=count+1;
}
}
else
{
if (k1==1)
{
j=0;
k1=0;
}
else
i++;
}
}

if (k==1)
{
printf("\n\nThe given sub-string is present in the main
string.");
printf("\nIt is present %d times.",count);
}

else
{
if (k==0)
printf("\n\nThe given sub-string is not present in the
main string.");
}

}

Is This Answer Correct ?    10 Yes 3 No

Post New Answer

More Manual Testing Interview Questions

consider therez 1 land and it has mango trees in it, what are the tets cases or how will we count no of mangoes on all trees

0 Answers  


write test cases for scenario of 'remember me' check box for log in screen.

4 Answers   Fiserv, InfoPlus,


What is precise of measurement?

1 Answers  


Are monkey testing & gorilla testing same? If not, then what is the difference between these two?

29 Answers   CTS, Sanoits, TCS,


what is sign off process in manual testing?

1 Answers   Cap Gemini, Virtusa,


What are triggers and procedures?

1 Answers  


what is master review and peer review

3 Answers  


What if the application has functionality that wasn't in the requirements?

1 Answers   IBM,


What usually indicates that your virtual user script has dynamic data that is dependent on you parameterized fields?

0 Answers  


what is the formal technical review

1 Answers   Accenture,


what is review?

3 Answers  


APPROACHES FOR WEB BASED APPLICATION TESTING. DIFFERENCE CBETWEEN WEB BASED APPLICATION AND CLIENT BASED APPLICATION

2 Answers   Ebix,


Categories