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 |
what is the main field of bugzilla which we fill to report bug to any developers???give some brief description??
how to use batchtesting in qtp?
What is ofx testing?
what is integration testing and end to end testing?
when u r going to faced difficulty in ur organization?
Write test cases for yahoo sign up page.
Difference between integration and regression testing?
What is the difference between functional specifications and non-functional specifications ?
what is the difference betwen quality center version 9.0 and version 10.0
What is code coverage?
Hi Guys, I have Cleared with 5 rounds with one company, i also faced an interview for client round, Can any body tel , aftr client round ,wil any body reject a candidate? Hello, y no response for my question.
Web application is having a client and a client-server application aslo have a client. Then what is the technical difference between thease two clients? can any body expain?