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 |
how will you define your bug status flow in softsmith qamonitor?
how to identify the test scenario
This is scenario based question atht I faced in an interview-"There are 2 systems with SIMILAR H/W and S/W configurations. I opened my gmail account from 1st system and I could open my gmail account successfully & able to operate it without any problem. But when i try to open my SAME gmail account from 2nd PC, I can't access it at all. So what could be possible defect/problem?" (Note that the email ID and password used is valid and correct)
write four critical test cases for logout operation?
What is diff b/n TRM(Test Responsibility Matrix) and RTM (requirement Tracebility matrix) or both are same??
Hi, this is sekhar yadav, who is given the seviarity and who is given the priarity
What do executive leaders, champions, Master Black belt, green belts and black belts mean?
define:usecase?
What is the scope of manual testing?Please let me know because I want my carrer as a tester.
what is system testing? explain with an example.
I have 1+ year exp. in web based testing & now I want to switch my job so anyone can tell me which types question generally ask in interview(which related to web based testing ) ???
how do i write perfect test case for functional testing