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 will you define your bug status flow in softsmith qamonitor?

2 Answers  


how to identify the test scenario

1 Answers  


This is scenario based question atht I faced in an interview-"There are 2 systems with SIMILAR H/W and S/W configurations. I opened my gmail account from 1st system and I could open my gmail account successfully & able to operate it without any problem. But when i try to open my SAME gmail account from 2nd PC, I can't access it at all. So what could be possible defect/problem?" (Note that the email ID and password used is valid and correct)

4 Answers   SoftTech,


write four critical test cases for logout operation?

6 Answers   Mind Tree,


What is diff b/n TRM(Test Responsibility Matrix) and RTM (requirement Tracebility matrix) or both are same??

5 Answers  


Hi, this is sekhar yadav, who is given the seviarity and who is given the priarity

8 Answers   CTS,


What do executive leaders, champions, Master Black belt, green belts and black belts mean?

0 Answers  


define:usecase?

4 Answers  


What is the scope of manual testing?Please let me know because I want my carrer as a tester.

0 Answers  


what is system testing? explain with an example.

1 Answers   Tech Mahindra,


I have 1+ year exp. in web based testing & now I want to switch my job so anyone can tell me which types question generally ask in interview(which related to web based testing ) ???

1 Answers  


how do i write perfect test case for functional testing

2 Answers  


Categories