Output Questions for Class 10 ICSE Computer Applications
Java Operators
Rewrite the following using ternary operator:
if(income < 10000) tax = 0; else tax = 12;
View Answer93 Likes
Java Operators
Determine the output of the following program.
public class PredictOutput2 { public static void main(String args[]) { int a = 6, b = 2, c = 3; System.out.println("Output 1: " + (a == b * c)); System.out.println("Output 2: " + (a == (b * c))); } }
View Answer24 Likes
Java Operators
Determine the output of the following program.
public class PredictOutput3 { public static void main(String args[]) { int a = 2, b = 2, c = 2; System.out.println("Output 1: " + (a + 2 < b * c)); System.out.println("Output 2: " + (a + 2 < (b * c))); } }
View Answer25 Likes
Java Operators
Determine the output of the following program.
public class Test { public static void main(String[] args) { int a = 1, b = 2; System.out.println("Output1: " + a + b); System.out.println("Output2: " + (a + b)); } }
View Answer33 Likes
Java Operators
Determine the output of the following program.
public class PredictOutput1 { public static void main(String args[]) { int a = 4, b = 2, c = 3; System.out.println("Output 1: " + (a = b * c)); System.out.println("Output 2: " + (a = (b * c))); } }
View Answer38 Likes
Java Operators
What will be the output for the following program segment?
int a=0,b=10,c=40; a = --b + c++ +b; System.out.println(" a = " + a);
View Answer101 Likes
Java Operators
Give the output of the program snippet.
int a = 10, b =12; if(a>=10) a++; else ++b; System.out.println(" a = " + a + " and b = " +b);
View Answer152 Likes
Java Operators
Predict the output:
int a=6,b=5; a += a++ % b++ *a + b++* --b;
View Answer90 Likes
Java Operators
Predict the output:
int a=6,b=5,c; c = (a++ % b++) *a + ++a*b++;
View Answer36 Likes
Java Iterative Stmts
Give the output of following code and mention how many times the loop will execute?
int i; for( i=5; i>=1; i--) { if(i%2 == 1) continue; System.out.print(i+" "); }
View Answer57 Likes
Showing 121 - 130 of 147 Questions