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 |
Write all combinations of test cases for calculater on + symbel
What is the difference between Product tester and Software Tester?Is there any difference?
What is Snapshot Testing? When we need to do and who will involve in this process and also what is the output document of this testing
What is an equivalence class
what is entry / exit criteria and pass / fail criteria ?
In any application there are so many fields. So tester have to test each field with Special chars., Alphabetic value, Alphanumeric value, Blank Space. etc. I am testing with all these inputs but should I have to consider these into test cases. Because rather than these there many functionalities to check.Please Guide me properly
Define cosmic bug.
what is application state, base state, & call state.
How to do Performance Testing manually for a Flash Application?
What is HTTP and TCP/IP
Hi! I have got an expirence of a year in Software(manual) testing in testing wep applications with ISTQB Certification...Kindly let me if there are any openings for the same,location :Chennai or Hyderabad..
Unit Testing can be done by using Nunit?