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.
Answer Posted / 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 View All Answers
How we will do Memory Testing? There is any tool to do that testing and to whome this testing to be performed?
when database testing comes into manual tesing
which of the following is not a coding defect? Option 1 Test harness defect Option 2 Data flow defect Option 3 Initialisation defect Option 4 Algorithmic defect
i looking for the software testing job with the exp of (1.5 yrs ), if anybody knows how to approach the companies ,pls let me know , possible que which will be asked in interview ? pls send me sample resume for testing ....pls do the favour as soon as posible .
what are the advantages of manual and automation testing ? and which one would u term as efficent testing and effective testing ?pls do reply thankx in advance
Tell some examples of bug severity and bug priority?
Which testing model is best as per your understanding, and why?
Am putting E-commerce project in my resume can any one please tell me about E-commerce application explaination..
what is test case management?explain in brief.
During alpha testing why customer people are invited?
Describe to me what you see as a process. Not a particular process, just the basics of having a process.
what is JAVA TESTING? What Testers will do in JAVA Testing. Can any one Give suitable Ans Pls. it's urgent
When should you opt for manual testing over automation testing?
There is only requirements document. You have 10 days and 8 resources to release the system.At the end of the 8th day u tell ur TL that system is ready for release. How will you proceed with the testing process or in other words what all approach you will follow once you get requirements
how can we give (ASSIGN) bug privitorirs and seviroty to the bug explain with exanple