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

Tell me agile process in your company

1 Answers   Cap Gemini,


What is the Regression Testing Process followed in your company?

3 Answers   HCL,


Explain the V model.

2 Answers   IBM,


What is mean by Funtional and Non-Funtional Testing?

3 Answers  


What is the difference between software Product and Project

14 Answers   AppLabs,


Write a Test scenario for Outlook Search functionality.

0 Answers   HCL,


we have combo box for country and states ,if we select India from country box it will Autometically add the all states of India in states box write a test cases for this

1 Answers   Nous,


Explain three tier architechture of the java project? what is the web server and what is the database server?

1 Answers   Infosys,


. Is any graph is used for code coverage analysis?

0 Answers   3i Infotech,


Hi all. I have 2 years exp in manual testing.Now i want to shift.i got so many email from other company that send ur cv .After sending no response from them .whats the reason.

1 Answers  


How does one go for testing of firewall?? Though one answer is posted but its not a relevant one

1 Answers   Wipro,


Hi everybody. In an interview i was asked to write the ECP for the range (1-10).

11 Answers   IBM,


Categories