class Test { public static void main(String args[]) { String s1 = "geeksquiz"; String s2 = "geeksquiz"; System.out.println("s1 == s2 is:" + s1 == s2);… Read More
Tag Archives: Operators
We have discussed Introduction to Operators in C where we got an overall idea of what types of Operators, C and C++ support, and its… Read More
#include <stdio.h> #include <stdlib.h> int top=0; int fun1() { char a[]= {'a','b','c','(','d'}; return a[top++]; } int main() { char b[10]; char ch2; int i =… Read More
class Base {} class Derived extends Base { public static void main(String args[]){ Base a = new Derived(); System.out.println(a instanceof Derived); } } (A)… Read More
Which of the following is not an operator in Java? (A) instanceof (B) sizeof (C) new (D) >>>= Answer: (B) Explanation: There is no sizeof… Read More
class Test { public static void main(String args[]) { System.out.println(10*20 + "GeeksQuiz"); System.out.println("GeeksQuiz" + 10*20); } } (A) 10*20GeeksQuiz GeeksQuiz10*20 (B) 200GeeksQuiz GeeksQuiz200 (C) 200GeeksQuiz… Read More
class Test { public static void main(String args[]) { System.out.println(10 + 20 + "GeeksQuiz"); System.out.println("GeeksQuiz" + 10 + 20); } } (A) 30GeeksQuiz GeeksQuiz30 (B)… Read More
Predict the output of following Java program. Assume that int is stored using 32 bits. class Test { public static void main(String args[]) { int… Read More
Predict the output of following Java Program class Test { public static void main(String args[]) { int x = -4; System.out.println(x>>1); int y = 4;… Read More
#include <stdio.h> int main() { int a = 0; int b; a = (a == (a == 1)); printf("%d", a); return 0; } (A) 0… Read More
#include <stdio.h> int main() { int y = 0; int x = (~y == 1); printf("%d", x); return 0; } (A) 0 (B) 1 (C)… Read More
#include <stdio.h> int main() { int x = 10; int y = (x++, x++, x++); printf("%d %d\n", x, y); return 0; } (A) 13 12… Read More
Predict the output of following program? # include <stdio.h> int main() { int x = 10; int y = 20; x += y += 10;… Read More
#include<stdio.h> int main() { int a = 2,b = 5; a = a^b; b = b^a; printf("%d %d",a,b); return 0; } (A) 5 2 (B)… Read More
Assume that the size of an integer is 4 bytes, predict the output of following program. #include <stdio.h> int main() { int i = 12;… Read More