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

Hello, I want to know how to write a regression test plan? Can someone please send me the format/template? Thanks in advance

2093


What is security Hole ? Is this possible Some one can acess any of restricted page (like admin side)? How you test this previllaze?

2357


What is srs and brs document?

1128


Risk Analysis a) 2 step, b)3 step, c) 4 step, d) 6 step

2010


what is TAS language which is used as a language for some projects/

1993


How to Generate Test Case for Shopping Cart?

2834


In what situation would you want to parameterize a text verification check?

2092


Discuss what test metrics you feel are important to publish an organization?

4865


Tell me a critical defect in which your Client,PM,PL appreciate on you

2033


Explain Test Plan with example? Explain following in the test plan with examples What is being tested? What are pass/fail criteria? When will each test occur? What Hardware & Software environment is required? What features must be tested? What features will not be tested? What are the responsibilities of individuals & organisation in the project?

2605


what is traceability matrix and its usefulness

4071


1.How to maintain the Bug status Report? 2.What is project based Company and product based company?

7929


Manual and automation how do they help in bringing out quality product? Explain?

1845


what is test strategy,test plan and test policy?Does anyone have dummy documents or any links that gives more idea about these?I am a beginner...interested in learning more abt testing.plz help and encourage me........!

1843


how we write test cases to brs,srs,hlds,llds

3279