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

1.what is verifacation,validation,how its achieved? 2.What is test techniques& strategy? 3.what is error,fault,failure? 4.what is Reviews,Walkthrough,Inspection & Audit? 5.What is Change management,Configuration management,Version control,Test harness? 6.Importance of Severity,Priority,explain Bug life cycle? 7.Difference between use case & test case with example? 8.When should stop testing? 9.Write a test case for online banking application in the topics user login,security,transaction to other accout,data protection. 10.If the software is tested but all the bugs was not fixed,will you release this software?If yes/No then why?

0 Answers   NDS,


On what basis is the Acceptance plan prepared?

0 Answers  


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  


How do you estimate white box testing?

0 Answers  


a apllication is given to you but the requirements and functionalities are missing what will you do to start the testing?

10 Answers   Wipro,


TELL ABOUT CMM & ISO LEVELS ? its URGENT plz

4 Answers  


Explain the difference between decision coverage and condition coverage ? If possible provide few examples.

3 Answers  


what is a test case?

7 Answers  


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

11 Answers   IBM,


plz explain about commonly used terms while writing testcases.Like to check,validate,on click etc.

1 Answers   TCS,


Explain what makes a good test engineer?

5 Answers   IBM,


how many levels of regression testing is avilable in our testing process?

2 Answers  


Categories