Sunteți pe pagina 1din 5

1.

Output of the following program is


main()
{
int iValue=0;
for(iValue=0;iValue<20;iValue++)
{
switch(iValue)
case 0:iValue+=5;
case 1:iValue+=2;
case 5:iValue+=5;
default iValue+=4;
break;
}
printf("%d,",iValue);
}
}
a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21

2. #define square(x) x*x
main()
{
int iValue;
iValue = 64/square(4);
printf("%d",iValue);
}
a) 64
b) 4
c) 16
d) 8

Ans: 64

3. main()
{
int iValue=_l_abc(10);
printf("%d\n",--iValue);
}
int _l_abc(int iValue)
{
return(iValue++);
}
a) 11
b) 9
c) 10
d) compile error



4. Which of the following is NOT true regarding recursion and iteration?
a) Any recursive method can be rewritten in an iterative form (with a loop)
b) Recursive calls take time and consume additional memory
c) In general, recursive algorithms lead to better performance than iterative algorithms
d) A recursive method is a method that calls itself

5. The space factor when determining the efficiency of algorithm is measured by
a) Counting the maximum memory needed by the algorithm
b) Counting the minimum memory needed by the algorithm
c) Counting the average memory needed by the algorithm
d) Counting the maximum disk space needed by the algorithm

6. Which of the following is the independent examination of a work product
a) Boundary value analysis
b) Coverage analysis
c) Bug
d) Audit

7. Which of the following statement is false with regards to Unit testing?
a) The goal of unit testing is to isolate each part of the program and show that the individual
parts are correct.
b) Unit testing is commonly automated, but cannot still be performed manually.
c) To ensure testing robustness and simplify maintenance, tests should never rely on other tests
nor should they depend on the ordering in which tests are executed.
d) Unit test should be written without explicit knowledge of the environment context in which
that they can be run anywhere at any time.

8. Which is a bottom-up approach to database design that design by examining the relationship
between attributes?
a) Functional dependency
b) Database modeling
c) Normalization
d) Decomposition

9. If n > 0, how many times will result be called to evaluate result(n) (including the initial call)?
a) 2
b) 2
n

c) 2n
d) n
2


10. class MyClass {
int iValue;
float fValue;
MyClass(int iX_Value, float fY_Value){
iValue=iX_Value;
fValue=fY_Value;
}
public static void main(String args[]){
MyClass myObj=new MyClass();
System.out.println(myObj.iValue=+myObj.iValue+, myObj.jValue=+myObj.jValue);
}
a) myObj.iValue=0, myObj.jValue=0.0
b) The code may result in compile time error
c) The code may result in run time error
d) The code displays a garbage value

11. With pointer variables, you can _______________ manipulate data stored in other variables.
a) never
b) seldom
c) indirectly
d) all of these

12. The contents of pointer variables may be changed with mathematical statements that
performs
a) all mathematical operators that are legal in C
b) multiplication and division
c) addition and subtraction
d) b and c

13. What explains briefly but clearly, what the test case is doing?
a) test case name
b) test procedure
c) input condition
d) expected result

14. Which techniques is used to identifying the case in which, it consists of dividing all possible
inputs into a set of classes, where either all inputs that fall into a given class are valid or all are
invalid. Then selecting a few test cases from each class is sufficient.
a) Equivalence portioning
b) boundary value analysis
c) logic coverage
d) random generation


15. High level design of an algorithm
a) flowchart
b) logic code
c) pseudocode
d) data flow

S-ar putea să vă placă și