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 |
Tell me agile process in your company
What is the Regression Testing Process followed in your company?
Explain the V model.
What is mean by Funtional and Non-Funtional Testing?
What is the difference between software Product and Project
Write a Test scenario for Outlook Search functionality.
we have combo box for country and states ,if we select India from country box it will Autometically add the all states of India in states box write a test cases for this
Explain three tier architechture of the java project? what is the web server and what is the database server?
. Is any graph is used for code coverage analysis?
Hi all. I have 2 years exp in manual testing.Now i want to shift.i got so many email from other company that send ur cv .After sending no response from them .whats the reason.
How does one go for testing of firewall?? Though one answer is posted but its not a relevant one
Hi everybody. In an interview i was asked to write the ECP for the range (1-10).