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

Have you worked in UDAP (Credit Card act 2009) project?What did you test in Billing & Payment modules?

0 Answers  


Have you ever completely tested any part of a product? How?

0 Answers   TCS,


I have password field in my application.while entering data into pwd field the characters are not encrypted will it come under gui testing or unit testing? is gui testing checked by typing or entering data into fields?

7 Answers  


write testcase for print option using mswod

1 Answers   Bally Technologies,


what is the part of qa and qc in refinement v model.

2 Answers  


how to write test case in testing give some examples plz help me any one?

4 Answers  


9.Data – driver automation typically includes?

0 Answers   Hewitt,


how testing is carried out in real time agile methodology i mean to say how a job is assigned to one tester in a team

2 Answers  


1. can u explain about testing levels and its type with example? 2. First explain about both testing.then difference B/W sanity and smoke testing? 3. Explain about integration , functional , system testing? 4. what are methods use to writing test cases?

2 Answers   Wipro,


how can we do database testing. In database testing we verify the data integrity and data validation. how can we do testing of Index, triggers, views, ransactions,cursors etc

0 Answers  


Test cases for 1Ltr water bottle

2 Answers  


If project wants to release in 3months what type of risk analysis you do in test plan?

0 Answers  


Categories