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

Write all combinations of test cases for calculater on + symbel

0 Answers  


What is the difference between Product tester and Software Tester?Is there any difference?

8 Answers  


What is Snapshot Testing? When we need to do and who will involve in this process and also what is the output document of this testing

0 Answers   HP,


What is an equivalence class

3 Answers   3i Infotech,


what is entry / exit criteria and pass / fail criteria ?

1 Answers  


In any application there are so many fields. So tester have to test each field with Special chars., Alphabetic value, Alphanumeric value, Blank Space. etc. I am testing with all these inputs but should I have to consider these into test cases. Because rather than these there many functionalities to check.Please Guide me properly

2 Answers  


Define cosmic bug.

3 Answers   Cyber Technology,


what is application state, base state, & call state.

1 Answers   TCS,


How to do Performance Testing manually for a Flash Application?

0 Answers   CTS, Oracle,


What is HTTP and TCP/IP

3 Answers   AZTEC,


Hi! I have got an expirence of a year in Software(manual) testing in testing wep applications with ISTQB Certification...Kindly let me if there are any openings for the same,location :Chennai or Hyderabad..

1 Answers  


Unit Testing can be done by using Nunit?

0 Answers   QuestPond,


Categories