KnowledgeBoat Logo

Output Questions for Class 10 ICSE Computer Applications

  • Java Conditional Stmts

    Predict the Output of the given snippet, when executed:

    int x=1,y=1;
    if(n>0) 
    {
    x=x+1; 
    y=y+1;
    }
    

    What will be the value of x and y, if n assumes a value (i) 1 (ii) 0?

    View Answer

    82 Likes


  • Java Conditional Stmts

    Predict the Output of the given snippet, when executed:

    switch (opn)
    {
    case 'a':
    System.out.println("Platform Independent"); 
    break;
    case 'b':
    System.out.println("Object Oriented");
    case 'c':
    System.out.println("Robust and Secure"); 
    break;
    default:
    System.out.println("Wrong Input");
    }
    

    When (i) opn = 'b' (ii) opn = 'x' (iii) opn = 'a'

    View Answer

    60 Likes


  • Java Conditional Stmts

    Give the output of the snippet:

    int a=10,b=12;
    if(a==10&&b<=12)
    a--;
    else
    ++b;
    System.out.println(a + "and" +b);
    
    View Answer

    44 Likes


  • Java Conditional Stmts

    Give the output of the snippet:

    int a=10,b=12;
    if(a>=10)
    a++;
    else
    ++b;
    System.out.println(a + "and" +b);
    
    View Answer

    25 Likes


  • Java Conditional Stmts

    Predict the output and the number of times the loop runs:

    class Test {
        public static void main(String args[]) {
            int i;
            for(i=0;i<5;i++)
                System.out.println(i-i*i);
        }
    }
    
    View Answer

    47 Likes


  • Input in Java

    Predict the output of the given snippet, when executed:

    int b=3,k,r;
    float a=15.15,c=0;    
    if(k==1)              
    {                     
    r=(int)a/b;           
    System.out.println(r);
    }                     
    else                  
    {                     
    c=a/b;                
    System.out.println(c);
    
    View Answer

    52 Likes


  • Input in Java

    Predict the output of the given snippet, when executed:

    int x = 1,y = 1;
    if(n > 0)    
    {           
    x = x + 1;    
    y = y + 1;     
    }           
    System.out.println(x + " , " + y);
    

    What will be the values of x and y, if the value of n is given as:
    (i) 1
    (ii) 0 ?

    View Answer

    52 Likes


  • Input in Java

    Predict the output of the given snippet, when executed:

    int a=1,b=1,m=10,n=5;
    if((a==1)&&(b==0))
    {
    System.out.println((m+n)); 
    System.out.println((m-n));
    }
    if((a==1)&&(b==1))
    {
    System.out.println((m*n)); 
    System.out.println((m%n));
    } 
    
    
    View Answer

    44 Likes


  • Input in Java

    Write the output for the following:

    System.out.println("Incredible"+"\n"+"world");

    View Answer

    23 Likes


  • Input in Java

    Give the output of the following program segment:

    System.out.println("nine:" + 5 + 4);
    System.out.println("nine:" + (5 + 4));
    
    View Answer

    22 Likes


Showing 21 - 30 of 147 Questions