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 ? | 10 Yes | 3 No |
consider therez 1 land and it has mango trees in it, what are the tets cases or how will we count no of mangoes on all trees
write test cases for scenario of 'remember me' check box for log in screen.
What is precise of measurement?
Are monkey testing & gorilla testing same? If not, then what is the difference between these two?
29 Answers CTS, Sanoits, TCS,
what is sign off process in manual testing?
1 Answers Cap Gemini, Virtusa,
What are triggers and procedures?
what is master review and peer review
What if the application has functionality that wasn't in the requirements?
What usually indicates that your virtual user script has dynamic data that is dependent on you parameterized fields?
what is the formal technical review
what is review?
APPROACHES FOR WEB BASED APPLICATION TESTING. DIFFERENCE CBETWEEN WEB BASED APPLICATION AND CLIENT BASED APPLICATION