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 |
Recently igot job,Please,help me,Can u explain the real time process of manual Testing from starting.Please don't mind.
if you have compressed file which has multiple source files,after make of this source file, you are getting undefinedreference error. How your will debug this problem ? Whatmight be different root causes for this ?
Tell me the Severity and Priority for the following Case. Login Page is not opening for the First Time - For Valid inputs and the login page is opening for the second time for valid inputs.....
Explain Water fall Model
Hi...What is Test design and Test data management in Test plan Document?
What is online testing?
If any bug is found in exploratory testing, then may I consider it as a test case?
What is Test Policy
How would you do the ollowing Security Testing for web application? 1) Authentication. 2) Authorization. 3) cookies. 4) penetration testing. 5) session testing. 6) encryption and decryption testing
how to test an web application. and what step have to considered first.
Integraton testing
What do you do in Configuration Management?