How many times does the following code segment execute
int x=1, y=10, z=1;
do{y--; x++; y-=2; y=z; z++} while (y>1 && z<10);
A) 1
B) 10
C) 5
D) infinite

1 Answer

Answer :

A) 1

Related questions

Description : Debugger is a program that (A) allows to examine and modify the contents of registers (B) does not allow execution of a segment of program (C) allows to set breakpoints, execute a segment of program and display contents of register (D) All of the above

Last Answer : (C) allows to set breakpoints, execute a segment of program and display contents of register

Description : What error will be generated if a space is given between the logical AND operator (&&)? Will it be a compile-time or a run-time error?

Last Answer : Example: if(5>2 & & 6

Description : Assume that variable x resides at memory location 1234, y at 1111 and p at 2222. Int x=1, y=2, *p; p=&x; y=*p; What will be the value of y after execution of above code? A) 2 B) 1 C) 1234 D) 1111

Last Answer : C) 1234

Description : When the following code is executed what will be the value of x and y? int x = 1, y=0; y = x++; (A) 2, 1 (B) 2, 2 (C) 1, 1 (D) 1, 2

Last Answer : (A) 2, 1

Description : In perspective projection, if a line segment joining a point which lies in front of the viewer to a point in back of the viewer is projected to a broken line of infinite extent. This is known ... ....... (A) View confusion (B) Vanishing point (C) Topological distortion (D) Perspective foreshortening

Last Answer : (C) Topological distortion 

Description : A three dimensional array in C' is declared as int A[x][y][z]. Here, the address of an item at the location A[p][q][r] can be computed as follows (where w is the word length of an integer): (A) &A[0][0][0]+w(y*z*q+z*p+r) (B) &A ... *q+r) (C) &A[0][0][0]+w(x*y*p+z*q+r) (D) &A[0][0][0]+w(x*y*q+z*p+r)

Last Answer : Answer: B

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 : 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 : If f(x, y) is a digital image, then x, y and amplitude values of f are (A) Finite (B) Infinite (C) Neither finite nor infinite (D) None of the above

Last Answer : (A) Finite

Description : How many times will the loop execute? int value1 = 7. value2=19 ; do -Technology

Last Answer : 4 timeswill the loop execute.

Description : The correct way to round off a floating number x to an integer value is (A) y = (int)(x+0.5) (B) y = int(x+0.5) (C) y = (int)x+0.5 (D) y = (int)((int)x+0.5)

Last Answer : (A) y = (int)(x+0.5)

Description : Consider a window bounded by the lines : x = 0; y= 0; x = 5 and y = 3. The line segment joining (–1, 0) and (4, 5), if clipped against this window will connect the points (A) (0, 1) and (2, 3) (B) (0, 1) and (3, 3) (C) (0, 1) and (4, 3) (D) (0, 1) and (3, 2)

Last Answer : (A) (0, 1) and (2, 3)

Description : What does the && operator do in a program code?

Last Answer : The && is also referred to as AND operator. When using this operator, all conditions specified must be TRUE before the next action can be performed. If you have 10 conditions and all but 1 fails to evaluate as TRUE, the entire condition statement is already evaluated as FALSE.

Description : What will be the values of x, m and n after execution of the following statements? Int x, m, n; m=10; n=15; x= ++m + n++; A) x=25, m=10, n=15 B) x=27, m=10, n=15 C) x=26, m=11, n=16 D) x=27, m=11, n=16

Last Answer : C) x=26, m=11, n=16

Description : 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

Last Answer : (2) 95 

Description : How many times the word 'print' shall be printed by the following program segment? for(i=1, i≤2, i++) for(j=1, j≤2, j++) for(k=1, k≤2, k++) printf("print/n") (A) 1 (B) 3 (C) 6 (D) 8

Last Answer : (D) 8

Description : Preparedstatement Object in JDBC is used to execute ........................... queries. A) executable B) simple C) high level D) parameterized

Last Answer : D) parameterized

Description : Prepared Statement object in JDBC used to execute........... queries. A) Executable B) Simple C) High level D) Parameterized

Last Answer : D) Parameterized

Description : Which method will a web browser call on a new applet? A) main method B) destroy method C) execute method D) init method

Last Answer : D) init method

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 : The type(s) of auto executing macros, in Microsoft word is/are A) Auto execute B) Auto macro C) Command macro D) All of the above

Last Answer : D) All of the above

Description : A process that execute only in main memory is referred to as ……………… and that allocated in disk is referred to a ……………. A) virtual memory, true memory B) virtual memory, real memory C) real memory, virtual memory D) imaginary memory, real memory

Last Answer : C) real memory, virtual memory

Description : .............. refers to a situation in which a process is ready to execute but is continuously denied access to a processor in deference to other processes. A) Synchronization B) Mutual Exclusion C) Dead lock D) Starvation

Last Answer : D) Starvation

Description : With ................ only one process can execute at a time; meanwhile all other process are waiting for the processer. With .............. more ... . A) Multiprocessing, Multiprogramming B) Multiprogramming, Uniprocessing C) Multiprogramming, Multiprocessing D) Uniprogramming, Multiprocessing

Last Answer : C) Multiprogramming, Multiprocessing

Description : .................. executes must frequently and makes the fine grained decision of which process to execute the next. A) Long-term scheduling B) Medium-term scheduling C) Short-term scheduling D) None of the above

Last Answer : C) Short-term scheduling

Description : What is the output when we execute list(“hello”)? a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]. b) [‘hello’]. c) [‘llo’]. d) [‘olleh’].

Last Answer : a) [‘h’, ‘e’, ‘l’, ‘l’, ‘o’].

Description : A set of processors P1, P2, ......, Pk can execute in parallel if Bernstein's conditions are satisfied on a pair wise basis; that is  P1 || P2 || P3 || ..... || Pk if and only if: (A) Pi || Pj for all i ≠ j (B) Pi || Pj for all i = j+1 (C) Pi || Pj for all i ≤ j (D) Pi || Pj for all i ≥ j

Last Answer : (A) Pi || Pj for all i ≠ j Explanation: Bernstein's Condition: 1. If process Pi writes to a memory cell Mi, then no process Pj can read the cell Mi. 2. If process Pi read from a memory ... Mi. 3. If process Pi writes to a memory cell Mi, then no process Pj can write to the cell Mi.

Description : Assume that a program will experience 200 failures in infinite time. It has now experienced 100 failures. The initial failure intensity was 20 failures/CPU hr. Then the current failure intensity will be (A) 5 failures/CPU hr (B) 10 failures/CPU hr. (C) 20 failures/CPU hr. (D) 40 failures/CPU hr.

Last Answer : (B) 10 failures/CPU hr.

Description : X, Y, Z are engaged to do a certain piece of work for Rs.8200.Y and Z are to execute 15/26 of the work together. Amount to be paid to X is A) 4287 B) 3469 C) 6124 D) 2865

Last Answer : Answer: B)  Y and Z are execute 15/26 of week Balance =1-15/26  11/26 of work completed by X  X’s share of revenue  =11/26 *8200  =Rs 3469

Description : The simplified function in product of sums of Boolean function F(W, X, Y, Z) = Σ(0, 1, 2, 5, 8, 9, 10) is (A) (W' + X') (Y' + Z') (X' + Z) (B) (W' + X') (Y' + Z') (X' + Z') (C) (W' + X') (Y' + Z) (X' + Z) (D) (W' + X') (Y + Z') (X' + Z)

Last Answer : (A) (W' + X') (Y' + Z') (X' + Z)

Description : What does the following declaration mean ? int (*ptr) [10]; (A) ptr is an array of pointers of 10 integers. (B) ptr is a pointer to an array of 10 integers. (C) ptr is an array of 10 integers. (D) none of the above.

Last Answer : (B) ptr is a pointer to an array of 10 integers.

Description : Compute the value of adding the following two fuzzy integers: A = {(0.3,1), (0.6,2), (1,3), (0.7,4), (0.2,5)} B = {(0.5,11), (1,12), (0.5,13)} Where fuzzy addition is defined as μA+B(z) = maxx+y=z (min(μA(x), μB( ... ,18)} (D) {(0.3,12), (0.5,13), (0.6,14), (1,15), (0.7,16), (0.5,17), (0.2,18)}

Last Answer : (D) {(0.3,12), (0.5,13), (0.6,14), (1,15), (0.7,16), (0.5,17), (0.2,18)} 

Description : For an infinite sheet of positive charge, the electric field lines: w) run parallel to the sheet of charge x) are perpendicular to the sheet of charge and point in toward the sheet y) are perpendicular to the sheet of charge and point away from the sheet z) fall off as one over r squared

Last Answer : ANSWER: Y -- ARE PERPENDICULAR TO THE SHEET OF CHARGE AND POINT AWAY  

Description : PHP problem with && and possibly a malfuntioning array?

Last Answer : answer:Unfortunately the examples above don't really shed a lot of light without some additional information. Maybe we can help with some troubleshooting tips in general? A couple of things that come to mind ... is where you're expecting it. Good luck with it, I hope it all comes together.

Description : Name the operators listed below i) < ii) ++ iii) && iv) ?:

Last Answer : Ans. i) Less than comparison operator ii) Increment operator iii) And logical operator iv) Ternary operator

Description : What is the significance of the & and && operators in PL SQL ?

Last Answer : The & operator means that the PL SQL block requires user input for a variable. The && operator means that the value of this variable should be the same as inputted by the user previously ... span across different rollback segments or will it terminate ? It will terminate (Please check ).

Description : If m and n are int type variables, what will be the result of the expression m% n when m=5 and n=2 ? A) 0 B) 1 C) 2 D) None of the above

Last Answer : B) 1

Description : main() { Int a=3, b=2, c*d*e; d=&a; e=&b; c=*d+*e; } Which one of the given answers is correct? A) a=4, c-6 B) a=3, c=5 C) a=3, c=6 D) a=3, c=8

Last Answer : B) a=3, c=5

Description : int[ ] ={5,6,7,8,9} What is the value of a[3]? A) 9 B) 8 C) 7 D) 6

Last Answer : B) 8

Description : In homogenous coordinate system (x, y, z) the points with z = 0 are called (A) Cartesian points (B) Parallel points (C) Origin point (D) Point at infinity

Last Answer : (D) Point at infinity

Description : A Boolean operator Ө is defined as follows: 1Ө1=1, 1Ө0=0, 0Ө1=0 and 0Ө0=1 What will be the truth value of the expression (xӨy)Өz = xӨ(yӨz)? (A) Always false (B) Always true (C) Sometimes true (D) True when x, y, z are all true

Last Answer : (B) Always true

Description : The sum of products expansion for the function F(x, y, z) = (x + y)z’ is given as (A) x’y’z + xyz’ + x’yz’ (B) xyz + xyz’ + xy’z’ (C) xy’z’ + x’y’z’ + xyz’ (D) xyz’ + xy’z’ + x’yz’

Last Answer : (D) xyz’ + xy’z’ + x’yz’ Explanation: Use Boolean identities to expand the product and simplify. F(x, y, z)=(x + y)z’  =xz’+yz’ Distributive law  =x1z’+1yz’ Identity law  =x(y+y’)z’+(x+x’)yz’ Unit property =xyz’+xy’z’+xyz’+x’yz’ Distributive law  =xyz’+xy’z’+x’yz’ Idempotent law 

Description : For the implementation of a paging scheme, suppose the average process size be x bytes, the page size be y bytes, and each page entry requires z bytes. The optimum page size that minimizes the total overhead due to the page ... fragmentation loss is given by (A) x/2 (B) xz/2 (C) √2xz (D) (√xz)/2

Last Answer : (C) √2xz 

Description : There are exactly ................ different finite automata with three states x, y and z over the alphabet {a, b} where x is always the start state. (A) 64 (B) 256 (C) 1024 (D) 5832

Last Answer : Answer: D

Description : How many solutions are there for the equation x+y+z+u=29 subject to the constraints that x≥1, y≥2, z≥3 and u≥0? (A) 4960 (B) 2600 (C) 23751 (D) 8855

Last Answer : (B) 2600

Description : If int y = 10 then find int z = (++y * (y++ + 5));

Last Answer : Ans. Increment operator has the highest precedence. So, ++y and y++ will be evaluated starting from left. In ++y, the value of y will be incremented to 11 and then 11 will be used in the expression. When y++ is evaluated, the current ... int z = (++y * (y++ + 5)); = 11 * (11 + 5 ) = 11 * 16 = 176

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 : If an integer occupies 4 bytes and a character occupies 1 byte of memory, each element of the following structure would occupy how many bytes ? struct name { int age; char name[30]; }; A) 30 B) 32 C) 34 D) 36

Last Answer : C) 34

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