Question 41
Question 42
Question 43
The following is the comment written for a C function.
/* This function computes the roots of a quadratic equation a.x^2 + b.x + c = . The function stores two real roots in *root1 and *root2 and returns the status of validity of roots. It handles four different kinds of cases. (i) When coefficient a is zero irrespective of discriminant (ii) When discriminant is positive (iii) When discriminant is zero (iv) When discriminant is negative. Only in case (ii) and (iii) the stored roots are valid. Otherwise 0 is stored in roots. The function returns 0 when the roots are valid and -1 otherwise. The function also ensures root1 >= root2 int get_QuadRoots( float a, float b, float c, float *root1, float *root2); */
A software test engineer is assigned the job of doing black box testing. He comes up with the following test cases, many of which are redundant.
[caption width="800"] [/caption]
Which one of the following option provide the set of non-redundant tests using equivalence class partitioning approach from input perspective for black box testing?
Question 44
Consider the following recursive C++ function that takes two arguments
unsigned int foo(unsigned int n, unsigned int r) {
if (n > 0) return (n%r + foo (n/r, r ));
else return 0;
}
What is the return value of the function foo when it is called foo(345, 10)?
Question 45
Consider the same recursive C++ function that takes two arguments
unsigned int foo(unsigned int n, unsigned int r)
{
if (n > 0)
return (n % r + foo(n / r, r));
else
return 0;
}
What is the return value of the function foo when it is called as foo(513, 2)?
Question 46
Consider the following circuit involving three D-type flip-flops used in a certain type of counter configuration.
[caption width="800"] [/caption]If at some instance prior to the occurrence of the clock edge, P, Q and R have a value 0, 1 and 0 respectively, what shall be the value of PQR after the clock edge?
Question 47
Consider the data given in previous question. If all the flip-flops were reset to 0 at power on, what is the total number of distinct outputs (states) represented by PQR generated by the counter?
Question 48
Question 49
Question 50
There are 64 questions to complete.