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 |
Can the static testing be done for both web and client server application?
If you found any high priority bug before release product then what will you do as tester if you only tester in team??
find out the odd man out in following options GUI spy, Object Spy, Gui map editor, Inspector.
what is the architecture of your current project?
What is the difference between Compatibility and Configuration testing?
What is difference between V-Model and Agile Model?
How do you prepare a regression testing suite?
what is tracebility matrix?
how to test if there are 2000 requirements ro be tested in an application ?
Can any one tell me the format/columns for writing test scenarios in excel sheet?
Any one pls describe master and visa card are same equity or different. and is it possible have same card number different expiry date with each master and visa.
what is the diff. bw separate database testers and manual testers with sql knowledge guys... iam confusing so much ,,in cmpny database testers are not working on manual..? both positions are same are not? explian clesly with example? thank u