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.



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

How do you write DEFECT REPORT?

0 Answers  


what is system integration testing or UAT testing ?

2 Answers   Amdocs,


HI FRNDS, I HAVE 2.5 years OF exp In Manual Testing,Plz let me know if thr r any oppurtunities in any company in Bangalore ID:dsnithi@gmail.com Thanks in Advance

0 Answers  


what is peer test?

2 Answers   Semantic Space, SoftProdigy,


what is advantages and disadvantages of the Waterfall Model and V-Model ?

1 Answers   Crea,


When do we perform smoke testing?

0 Answers  


which out of the following can be considered as performance testing:- 1. Benchmarking 2.Recovery testing 3. more than one user testing

0 Answers   ADITI,


How do u test any "web-site" as a secure site...? or How do you test the security of a web-site...?

7 Answers   HCL,


what are the techniques(steps) to follow for writing test cases? could u explain me with brief real time example?

3 Answers   Intelligroup,


What type of Testing u done ur project?

5 Answers   Geometric Software,


what is d difference between software development life cycle & system development life cycle?

5 Answers   HP,


diff between test plan and test strategy?

5 Answers   Hoch Technologies,


Categories