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 / 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 ? | 9 Yes | 3 No |
How the test plan is a tool and the product?
Can any explain briefly about RBT (risk based testing
How sanitary or smoke testing process will done in the application?mainly how we start doing that test?
what are the critical bug occurs in banking domain?
how many buils u r getting in u'r project?
5 Answers Professional Access,
WAT IS RTVM?
suppose the product/appication has to deliver to client at 5.00PM,At that time you or your team member caught a high severity defect at 3PM.(Remember defect is high severity) But the the client is cannot wait for long time.You should deliver the product at 5.00Pm exactly.then what is the procedure you follow?
How will we come to know that its a bug,in what situations we consider it as a bug?
What is difference between Test Plan and Test Strategy
what is the difference betwen quality center version 9.0 and version 10.0
can any one of u give templates for test plan and test strategy
Swap 2 variables without using a temp variable