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 Answer

    91 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 Answer

    24 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 Answer

    24 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 Answer

    33 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 Answer

    38 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 Answer

    101 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 Answer

    152 Likes


  • Java Operators

    Predict the output:

    int a=6,b=5;
    a += a++ % b++ *a + b++* --b;
    
    View Answer

    90 Likes


  • Java Operators

    Predict the output:

    int a=6,b=5,c;
    c = (a++ % b++) *a + ++a*b++;
    
    View Answer

    36 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 Answer

    57 Likes


Showing 121 - 130 of 147 Questions