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
!what are the entry criteria for antomation testing ?
what is acid testing?
How to test a Falsh player scrollings?
we are about to implement a Test tool to test the performance of website, so what script does a tester should know (friends plz help me)
What types of testing is specifically important for web testing?
Can any1 tell me suppose u r doing manual testing on unix platform with Shell Script, then how it is done? How u r implementing it & what is the use of Shell scripting on Manual Testing?
1. what is baseline document , can you say any two ?
You have a testing team of 10 members, and now you have to reduce it by 5 member and you dont want to increase risk in your product, you are try to cover all functionality to test. What test Strategy you follow.
IF ASCII_CODE_OF_ENTERED_CHAR is less than 44 THEN reject it ELSE IF ASCII_CODE_OF_ENTERED_CHAR is greater than 56 THEN reject it ELSE it's a digit, so accept it Which one of the following sets of ASCII codes do you use to test the sample code above WITHOUT redundant coverage?
i want manual and automation test cases and interview questions
how will we change the server system time?
Explain severity with example and expalin each example?
Pls u can u r mail id to my personal mail id also if they dont want to give u r mail id n comman place
When the GUI Testing will be held on the V model ?
Define Stability, Scalability and reliability with example ?