Skip to content

Category Archives: Program Output

1. What will be the output of following program? #include<iostream>    using namespace std; int main()  {     int x = 5;    if(x==5)   {        if(x==5) break;… Read More
Pre-requisite: Polymorphism in java 1) What is the output of the following program? class GFG {     protected void getData()     {         System.out.println("Inside GFG");     } } class… Read More
Short question based on c loops 1. What will be the output of the following code? #include <stdio.h> int main() {     int i = 0,… Read More
Ques 1. Assume that the size of an integer is 4 bytes and size of character is 1 byte. What will be the output of… Read More
Difficulty level : Easy Prerequisite : final keyword in java Predict the output of following Java Programs: What will be output of following program? class… Read More
1) What is the output of the following program? import threading    barrier = threading.Barrier(4)    class thread(threading.Thread):     def __init__(self, thread_ID, thread_name):         threading.Thread.__init__(self)         self.thread_ID =… Read More
What task does the following program perform?   CPP #include<iostream> #include<fstream> using namespace std;   int main() {    ofstream ofile;    ofile.open ("text.txt");    ofile << "geeksforgeeks" <<… Read More
Prerequisite – Loops in Python Predict the output of the following Python programs. 1) What is the output of the following program? x = ['ab',… Read More
You came across how to generate random numbers and use of two C function rand() and srand() from the article rand() and srand() in C\C++.Listed… Read More
Predict the output of the following C programs.1. What will be the output of following program? Input:  1 3 C #include<stdio.h> int main() {     int a,… Read More
Prerequisite: Strings   Question What is the Output?  CPP #include <iostream> #include <cstring> using namespace std;   int main() {     char s1[] = "geeksforgeeksforgeeks";     char s2 =… Read More
Prerequisite: Access modifiers in c, Inheritance 1. What is the output?  C++ #include <iostream> using namespace std;   class access {     int a = 10;… Read More
Prerequisite: Regular Expressions Note: Output of all these programs is tested on Python3  1) Which of the options below could possibly be the output of… Read More
Prerequisite: Dictionary Note: Output of all these programs is tested on Python31) What is the output of the following program?   PYTHON3 D = dict() for x… Read More
Prerequisite: Constructors and Destructors 1) What is the output of the following program? #include <iostream> using namespace std; class Sand {     public: Sand()         {             cout… Read More