Consider the following JAVA program:

public class First {

public static int CBSE (int x) {

if (x < 100) x = CBSE (x +10);

return (x - 1);

}

public static void main (String[] args){

System.out.print(First.CBSE(60));

}

}

What does this program print?

(1) 59

(2) 95

(3) 69

(4) 99

1 Answer

Answer :

(2) 95 

Related questions

Description : The scores of an English test out of 100 of 20 students are given below : 75, 69, 88, 55, 95, 88, 73, 64, 75, 98, 88, 95, 90, 95, 88, 44, 59, 67, 88, 99. -Maths 9th

Last Answer : Median=n=even =n/2=20/2=10th observation =98 Mode =88

Description : The scores of an English test out of 100 of 20 students are given below : 75, 69, 88, 55, 95, 88, 73, 64, 75, 98, 88, 95, 90, 95, 88, 44, 59, 67, 88, 99. -Maths 9th

Last Answer : Median=n=even =n/2=20/2=10th observation =98 Mode =88

Description : What would happen if "String[]args" is not included as argument in the main method. A) No error B) Compilation error C) Program won't run D) Program exit

Last Answer : C) Program won't run

Description : Is it compulsory to write String args[] when running a program in BlueJ?

Last Answer : A: No it is not compulsory when we are running it in BlueJ. But normally (in all other cases) it is always better to have it, as the JVM looks for the main method with a String array as a parameter.

Description : The Servlet Response interface enables a servlet to formulate a response for a client using the method ............... (A) void log(Exception e, String s) (B) void destroy() (C) int getServerPort() (D) void setContextType(String Type)

Last Answer : (D) void setContextType(String Type)

Description : A method name myMethod( ) that needs two integer arguments is declared as A) public void myMethod( ); B) public void myMethod(int a, int b); C) public void myMethod(int a, b); D) public int myMethod(a, b);

Last Answer : B) public void myMethod(int a, int

Description : Define a class student with int id and string name as data members and a method void SetData ( ). Accept and display the data for five students.

Last Answer : import java.io.*; class student { int id; String name; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); void SetData() { try { System.out.println("enter id and name for student"); ... (String are[]) {  student[] arr;  arr = new student[5];  int i;  for(i=0;i

Description : Trace the error: void main( ) { int *b, &a; *b = 20 printf(“%d, %d”, a, *b) } (A) No error (B) Logical error (C) Syntax error (D) Semantic error

Last Answer : (C) Syntax error

Description : Fullerenes form a class of carbon allotropes. The first one to be identified was - (1) C-59 (2) C-60 (3) C-61 (4) C-69

Last Answer : (2) C-60 Explanation: The first fullerene to be identified was C-60 which has carbon atoms arranged in the shape of a football. Since this looked like the geodesic dome designed by the US architect Buckminster Fuller, the molecule was named fullerene.

Description : Which of the following characteristics of constructor are true. i) They should be declared in the public section. ii) They are invoked automatically when the objects are created. iii) They do not have return type and void also. ... and v C) Only i, iii, iv and v D) All i, ii, iii, iv and v

Last Answer : D) All i, ii, iii, iv and v

Description : The class string belongs to ................... package. A) java.awt B) java.lang C) java.applet D) java.string

Last Answer : B) java.lang

Description : Consider a program that consists of 8 pages (from 0 to 7) and we have 4 page frames in the physical memory for the pages. The page reference string is :  1 2 3 2 5 6 3 4 6 3 7 3 1 5 3 6 3 4 2 4 3 4 5 ... to fill available page frames with pages): (A) 9 and 6 (B) 10 and 7 (C) 9 and 7 (D) 10 and 6

Last Answer : (B) 10 and 7

Description : What is the value returned by the function f given below when n = 100 ? int f(int n)  { if (n==0) then return n;  else return n + f(n-2);  } (A) 2550 (B) 2556 (C) 5220 (D) 5520

Last Answer : (A) 2550

Description : Give output for following code: class student { int roll no; char name [14]; } s[6]; void main() { cout<<sizeof(s); }

Last Answer : Considering roll_no(Single variable) the output is: 96 OR Considering roll, no (Two variables) the output is: 108 OR Considering roll no the output is: error – space between roll and no

Description : In C++, the keyword void was used ……….. A) To specify the return type of function when it is not returning any value. B) To indicate an empty argument list to a function. C) To declare the generic pointers. D) All of the above.

Last Answer : D) All of the above.

Description : In java, string is a ............. A) primitive data type B) abstract data type C) combination of boolean D) None of the above

Last Answer : B) abstract data type

Description : What does the following command do? grep −vn abc x (A) It will print all of the lines in the file x that match the search string abc (B) It will print all of the lines in file x that do not ... (D) It will print the specific line numbers of the file x in which there is a match for string abc

Last Answer : (A) It will print all of the lines in the file x that match the search string “abc”

Description : State true or false for Java Program. i) Data members of an interface are by default final ii) An abstract class has implementations of all methods defined inside it. A) i-false, ii-false B) i-false, ii-true C) i-true, ii-false D) i-true, ii-true

Last Answer : C) i-true, ii-false

Description : State true or false for Java Program. i) All class variables are instance variables ii) All protected methods are friendly methods A) i-false, ii-false B) i-false, ii-true

Last Answer : B) i-false, ii-true

Description : Calculate coefficient of viscous damper, if the system is critically damped. Consider the following data: 1. Mass of spring mass damper system = 350 kg 2. Static deflection = 2 x 10 -3 m 3. Natural frequency of the system = 60 rad/sec ... /m B. 80 x 10 3 N-s/m C. 42 x 10 3 N-s/m D. None of the above

Last Answer : C. 42 x 10 3 N-s/m

Description : Calculate coefficient of viscous damper, if the system is critically damped. Consider the following data: 1. Mass of spring mass damper system = 350 kg 2. Static deflection = 2 x 10 -3 m 3. Natural frequency of the system = 60 rad/sec ... /m b. 80 x 10 3 N-s/m c. 42 x 10 3 N-s/m d. None of the above

Last Answer : c. 42 x 10 3 N-s/m

Description : Java servlets are an efficient and powerful solution for creating ………….. for the web. A) Dynamic content B) Static content C) Hardware D) Both a and b

Last Answer : A) Dynamic content

Description : Match the following types of variables with the corresponding programming languages: (a) Static variables (i) Local variables in Pascal (b) Stack dynamic (ii) All variables in APL (c) Explicit heap dynamic (iii) Fortran 77 (d) Implicit ... (ii) (C) (iii) (i) (iv) (ii) (D) (ii) (i) (iii) (iv)

Last Answer : (C) (iii) (i) (iv) (ii) 

Description : What will be the output of the following segment of the program? main( ) { char *s = “hello world”; int i = 7; printf(“%, *s”, i, s); } (A) Syntax error (B) hello w (C) hello (D) o world

Last Answer : Answer: Marks given to all

Description : Suppose that the number of instructions executed between page faults is directly proportional to the number of page frames allocated to a program. If the available memory is doubled, the mean interval between page faults is also ... memory were available? (A) 60 sec (B) 30 sec (C) 45 sec (D) 10 sec

Last Answer : Answer: C Explanation: T = Ninstr x 1µs + 15,000 x 2,000 µs = 60s Ninstr x 1µs = 60,000,000 µs - 30,000,000 µs = 30,000,000 µs Ninstr = 30,000,000 The number of instruction ... doesn't mean that the program runs twice as fast as on the first system. Here, the performance increase is of 25%.

Description : Which of the following is true about the static member variable in C++. i) It is initialized to zero when the first object of its class is created. Other initialization is also permitted. ii) It is visible only within ... , ii-True B) ii-False, ii-True C) i-True, ii-False D) i-False, iii-False

Last Answer : B) ii-False, ii-True

Description : Consider the reference string 0 1 2 3 0 1 4 0 1 2 3 4 If FIFO page replacement algorithm is used, then the number of page faults with three page frames and four page frames are .......... and ........... respectively. (A) 10, 9 (B) 9, 9 (C) 10, 10 (D) 9, 10

Last Answer : (D) 9, 10

Description : A software project was estimated at 352 Function Points (FP). A four person team will be assigned to this project consisting of an architect, two programmers, and a tester. The salary of the architect is Rs.80,000 per month, the ... ) Rs.28,16,000 (2) Rs.20,90,000 (3) Rs.26,95,000 (4) Rs.27,50,000

Last Answer : (4) Rs.27,50,000 

Description : Some of the situations where inline expansion may not work are: A) For functions returning values, if a loop, a switch or goto exists. B) If functions contain static variables and they are re-cursive. C) For functions not returning values, if return statement exist. D) All of the above.

Last Answer : D) All of the above.

Description : System.in.read() is being used, the program must specify the .................. clause. A) throws.java.out.IOException B) throws.java.in.IOException C) throws.java.io.IOException D) throws.java.io.InException

Last Answer : C) throws.java.io.IOException

Description : A disk drive has 100 cylinders, numbered 0 to 99. Disk requests come to the disk driver for cyclinders 12, 26, 24, 4, 42, 8 and 50 in that order. The driver is currently serving a request at cyclinder 24. A seek takes ... (SSTF) algorithm? (A) 0.984 sec (B) 0.396 sec (C) 0.738 sec (D) 0.42 sec

Last Answer : C

Description : Define what are the differences between static, public and void in C#?

Last Answer : 1. Static classes/methods/variables are accessible throughout the application without creating an instance. The compiler will store the method address as an entry point. 2. Public methods or variables are accessible ... 3. The void is used for the methods to indicate it will not return any value.

Description : What will be the output of the following ‘C’ code ? main ( ) { int x = 128; printf (“\n%d”, 1 + x++); } (A) 128 (B) 129 (C) 130 (D) 131

Last Answer :  (B) 129

Description : A body is executing simple harmonic motion of amplitude 1 cm. Its velocitywhile passing through the central point is 10 mm/sec. Its frequency will be a.2.99 rps b.2.22 rps c.1 rps d.1.59 rps e.1.77 rps

Last Answer : c. 1 rps

Description : How many seats are reserved for Scheduled Castes in the Lok Sabha? (1) 59 (2) 69 (3) 79 (4) 84

Last Answer : (4) 84 Explanation: For the purpose of constituting the Lok Sabha, the whole country has been divided into 543 Parliamentary Constituencies, each one of which elects one member. The members of ... the Scheduled Tribes. Earlier it was 79 and 41 for Scheduled Castes and Scheduled Tribes respectively.

Description : If the discharge of a sewer running half is 628 1.p.s., i = 0.001, and n = 0.010, the diameter of the sewer, is A. 1.39 m B. 1.49 m C. 1.59 m D. 1.69 m

Last Answer : ANS: D

Description : The sound power level of a jet plane flying at a height of 1 km is 160 dB. What is the maximum sound pressure level on the ground directly below the plane assuming that the aircraft radiates sound equally in all directions? A. 59.1 dB B. 69.1 dB C. 79.1 dB D. 89.1 dB

Last Answer : D. 89.1 dB

Description : (37) 0.75 x [(7056) 0.25] ÷ (64) – 2 = (8) ? (Take 3 digits after the decimal point) a) 95.357 b) 69.567 c) 96.257 d) 78.584 e) 88.598

Last Answer : (37) 0.75 x [(7056) 0.25] ÷ (64) – 2 = (8) ? Sol: 27.75 x 1764 ÷ 64 – 2 = 8 x ? 27.75 x 27.5625 – 2 = 8 x ? 762.859/8=? ? = 95.357 Answer: a)

Description : Consider the following three SQL queries (Assume the data in the people table) : (a) Select Name from people where Age>21; (b) Select Name from people where Height>180; (c) Select Name from people where (Age>21) or (Height ... number of rows returned by the SQL query (c) ? (A) 3 (B) 7 (C) 10 (D) 21

Last Answer : (C) 10

Description : What is significance of import java.io.* in your program?

Last Answer : A: The line imports all the classes of the java.io package into the current program.

Description : Match the following. a) Java 1) is a tool for debugging java program b) Javah 2) is a tool for creating C-like header files c) Javap 3) runs java bytecode d) jdb 4) prints java code representation A) a-3, b-2,c-1 B) a-3, b-1, c-4, d-2 C) a-1, b-2, c-3, d-4 D) a-2, b-1, c-3, d-4

Last Answer : B) a-3, b-1, c-4, d-2

Description : The compiled java program can run on any ..................... plateform having Java Virtual Machine (JVM) installed on it. A) program B) java C) hardware D) non java

Last Answer : C) hardware

Description : The jdb is used to A) Create a jar archive B) Debug a java program C) Create C header file D) Generate java documentation

Last Answer : B) Debug a java program

Description : The command javac A) Converts a java program into binary code B) Converts a java program into bytecode C) Converts a java program into machine language D) None of the above.

Last Answer : B) Converts a java program into bytecode

Description : The command javac is used to A) debug a java program B) compile a java program C) interpret a java program D) execute a java program

Last Answer : B) compile a java program

Description : Which one of the following is correct? (A) Java applets cannot be written in any programming language (B) An applet is not a small program. (C) An applet can be run on its own. (D) Applets are embedded in another applications. 

Last Answer : (D) Applets are embedded in another applications.

Description : In Java, when we implement an interface method, it must be declared as: (A) Private (B) Protected (C) Public (D) Friend

Last Answer : (C) Public

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them

Description : Which of the following methods belong to the string class? A) length( ) B) compare To ( ) C) equals ( ) D) All of them

Last Answer : D) All of them