Skip to content

Category Archives: Program Output

Difficulty level : IntermediatePredict the output of following Python Programs. Program 1:   Python class Acc:     def __init__(self, id):         self.id = id         id = 555   acc… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1 : public class Calculator {     int num = 100;     public void calc(int… Read More
Difficulty level : Intermediate Predict the output of following Java Programs. Program 1: class First {     public First() {  System.out.println("a"); } }     class Second… Read More
Predict the output of following python programs: Program 1: r = lambda q: q * 2 s = lambda q: q * 3 x =… Read More
Predict the output of following Java Programs.Program 1:   Java // Main.java public class Main {     public static void gfg(String s)     {            System.out.println("String");     }     public static… Read More
Predict the output below program #include<iostream> using namespace std; int main() {     int x = 1 , y = 1, z = 1;        cout… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> #include <string.h> using namespace std;    int main() {     cout << sizeof("GeeksforGeeks") << endl;… Read More
Predict the output of following Java Programs: Question 1 // file name: Main.java    class Base {     protected void foo() {} }  class Derived extends… Read More
Predict the output of the following Java Programs: Example1: Java // filename: Test.java   class Test {       // Declaring and initializing integer variable     int… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> using namespace std;    template <int N> class A {    int arr[N]; public:    virtual… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> using namespace std;    class A {     public:     A& operator=(const A&a)     {         cout <<… Read More
Predict the output of following C++ programs. Question 1 #include<iostream> using namespace std;    class Base  { public:     int fun()      { cout << "Base::fun() called";… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> using namespace std;    class A { public:     void print() { cout << "A::print()";… Read More
Predict the output of following C++ program. Difficulty Level: Rookie Question 1 #include <iostream> using namespace std;    class A {     int id; public:     A… Read More
Predict the output of following C++ program. #include<iostream> using namespace std;    class A {     // data members of A public:     A ()           { cout… Read More