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

what is the main field of bugzilla which we fill to report bug to any developers???give some brief description??

1 Answers  


how to use batchtesting in qtp?

4 Answers   TCS,


What is ofx testing?

1 Answers   Infosys,


what is integration testing and end to end testing?

1 Answers   Sapient,


when u r going to faced difficulty in ur organization?

1 Answers   Accenture,


Write test cases for yahoo sign up page.

2 Answers   NIIT,


Difference between integration and regression testing?

2 Answers  


What is the difference between functional specifications and non-functional specifications ?

4 Answers  


what is the difference betwen quality center version 9.0 and version 10.0

1 Answers  


What is code coverage?

3 Answers   3i Infotech,


Hi Guys, I have Cleared with 5 rounds with one company, i also faced an interview for client round, Can any body tel , aftr client round ,wil any body reject a candidate? Hello, y no response for my question.

3 Answers  


Web application is having a client and a client-server application aslo have a client. Then what is the technical difference between thease two clients? can any body expain?

4 Answers  


Categories