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

explain current project?

7 Answers   Verizon,


what is mean by client and server?

5 Answers  


what is monkey testing?

9 Answers   ITC Infotech,


how can u do database testing manually?

4 Answers   HCL,


how will u Do Smoke testing and Sanity testing for these fields:We have 3 fields on page: Name,Address and Pincode ?

6 Answers   HCL,


Explain me in detail V model with diagram?

1 Answers   CybAge,


WHAT R THE TYPES OF TESTING U KNOW AND U EXPERIENCED?

5 Answers   Infosys,


what is server-side testing? what is automation framework?

1 Answers   HCL,


What are the contents of a Test Plan?

6 Answers  


Hi frnds dis ajay. can any one tell me correctly vat is ENCRYPTION & DECRYPTION ? hw s these are used in testing ? its an interview... tank u all frnds.............

7 Answers   Valtech,


What are all the scenario for 1.google analytics 2.api 3.paypal

0 Answers  


In V-model both testing and development done simultaneosly,we know that.But how can you say that both happen parallely.how is it related in real time?This question has been asked to me today only.Can any one please help me on this?

2 Answers   Aditya Birla,


Categories