Predict the output:public class sookshmas{void call() // compilation fails at line 3{System.out.println("java");}}class s2 extends sookshmas{protected void call() //// compilation fails at line 10{System.out.println("oracle");}public static void main(String...k){sookshmas d=new s2();d.call();}}
Predict the output:int main(){char k='A';char k1='b';char k2='B';switch(k,k1,k2){case 'a':case 'A':printf("messi");break;case 'b':case 'B':printf("messi argentina");break;default: printf("football");}return 0;}
class Sook{public static void main(String args[]){int num [][] = new int [3][];num [0] = new int [3];num [1] = new int [2];num [2] = new int [1];num [0][0] = 1;num [0][1] = 2;num [0][2] = 3;num [1][0] = 4;num [1][1] = 5;num [2][0] = 6;for (int i = 0; i num.length; i++){for (int j = 0; j num[i].length; j++){System.out.print(" "+num[i][j]);}System.out.println();}}}
Predict the output:public class sookshmas{static{System.out.println(k);}static int k=10;public static void main(String...k){}}
What will be the output of the program?int main(){if(0)printf("welcome to c");if(-1)printf("all d best \n");else if(1)printf("for good learning \n");elseprintf("best of luck");return 0;}
When input : 1int main(){int a;int d=1;while((d++)==((scanf("%d",&d))==1)){printf(" c prog");}}