Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How we will do Memory Testing? There is any tool to do that testing and to whome this testing to be performed?

1971


when database testing comes into manual tesing

2207


which of the following is not a coding defect? Option 1 Test harness defect Option 2 Data flow defect Option 3 Initialisation defect Option 4 Algorithmic defect

2303


i looking for the software testing job with the exp of (1.5 yrs ), if anybody knows how to approach the companies ,pls let me know , possible que which will be asked in interview ? pls send me sample resume for testing ....pls do the favour as soon as posible .

2051


what are the advantages of manual and automation testing ? and which one would u term as efficent testing and effective testing ?pls do reply thankx in advance

1958


Tell some examples of bug severity and bug priority?

1100


Which testing model is best as per your understanding, and why?

1203


Am putting E-commerce project in my resume can any one please tell me about E-commerce application explaination..

2926


what is test case management?explain in brief.

2103


During alpha testing why customer people are invited?

1165


Describe to me what you see as a process. Not a particular process, just the basics of having a process.

2199


what is JAVA TESTING? What Testers will do in JAVA Testing. Can any one Give suitable Ans Pls. it's urgent

2062


When should you opt for manual testing over automation testing?

1240


There is only requirements document. You have 10 days and 8 resources to release the system.At the end of the 8th day u tell ur TL that system is ready for release. How will you proceed with the testing process or in other words what all approach you will follow once you get requirements

2207


how can we give (ASSIGN) bug privitorirs and seviroty to the bug explain with exanple

2307