Computer Applications
Write the values of c and d after execution of following code.
int a = 1;
int b = 2;
int c;
int d;
c = ++b;
d = a++;
c++;
Related Questions
Assertion (A) next() can read the input only till the space.
Reason (R) next() only gets to the line break.- Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
- Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
- Assertion (A) is true and Reason (R) is false.
- Assertion (A) is false and Reason (R) is true.
It can have the same access specifiers used for variables and methods.
- Method
- Class
- Constructor
- Object
Observe the following code and write how many times will the loop execute?
a = 5; b = 2; while(b != 0) { r = a % b; a = b; b = r; } System.out.println(" " + a);Write the values that will be assigned to x, y and t after executing the following code.
String s1, s2, x, y; int t; s1 = "classxii"; s2 = "cbseboard"; x = s1.substring(5, 8); y = s2.concat(s1); t = y.length(); System.out.println("x=" + x); System.out.println("y=" + y); System.out.println("t=" + t);