Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
C++
4k+ articles
C++ Programs
2.5k+ articles
C Language
1.8k+ articles
Constructors
37 articles
Inheritance
32 articles
C++-Constructors
29 articles
C++-Virtual Functions
26 articles
C++-Inheritance
22 articles
Virtual Functions
16 articles
Programming Language
>
C++
>
C++ Quiz
C++ Quiz
140+ posts
Popular Articles
Recent Articles
Increment odd positioned elements by 1 and decrement even positioned elements by 1 in an Array
Last Updated: 19 April 2024
Given an array arr[], the task is increment all the odd positioned elements by 1 and decrement all the even positioned elements by 1.Example
...read more
Interview Experiences
Algorithms
Competitive Programming
Programming Language
C Language
C++
C Quiz
C++ Quiz
C Programs
C++ Programs
DSA
C/C++ Puzzles
Experiences
Program to print 'N' alphabet using the number pattern from 1 to n
Last Updated: 11 July 2022
Given an integer N, the task is to print the Alphabet N Pattern as given below:1 12 2 23 3 3* * ** *
...read more
Pattern Searching
C Language
C++
C Quiz
C++ Quiz
C Programs
C++ Programs
DSA
C/C++ Puzzles
C++ | Inheritance | Question 11
Last Updated: 28 June 2021
[sourcecode language="C"]#includeiostreamusing namespace std;class Base{public : int x, y;public: Base(int i, int j){ x = i; y = j; }}
...read more
C Language
C++ Quiz
C++-Inheritance
Inheritance
Similar Topics
DSA
22.3k+ articles
C++
4k+ articles
C++ Programs
2.5k+ articles
C Language
1.8k+ articles
Constructors
37+ articles
Inheritance
32+ articles
C++-Constructors
29+ articles
C++-Virtual Functions
26+ articles
C++-Inheritance
22+ articles
Virtual Functions
16+ articles
C++ | Inheritance | Question 10
Last Updated: 28 June 2021
Output of following program?[tabby title="CPP"][sourcecode language="cpp"]#include #includeusing namespace std;class Base{public: virtual
...read more
C Language
C++ Quiz
C++-Inheritance
Inheritance
C++ | Exception Handling | Question 3
Last Updated: 28 June 2021
What should be put in a try block?1. Statements that might cause exceptions2. Statements that should be skipped in case of an exception (A)O
...read more
Exception Handling
C Language
C++ Quiz
C++-Exception Handling
C++ | Virtual Functions | Question 2
Last Updated: 28 June 2021
Predict output of the following program[sourcecode language="C"]#includeiostreamusing namespace std;class Base{public: virtual void show(
...read more
C Language
C++ Quiz
C++-Virtual Functions
Virtual Functions
C++ | Inheritance | Question 4
Last Updated: 28 June 2021
[sourcecode language="C"]#includeiostream using namespace std;class P {public: void print() { cout Inside P; }}; class Q : public P {pub
...read more
C Language
C++ Quiz
C++-Inheritance
Inheritance
C++ | new and delete | Question 4
Last Updated: 28 June 2021
What happens when delete is used for a NULL pointer?[sourcecode language="C"] int *ptr = NULL; delete ptr; [/sourcecode](A) Compiler Error(B
...read more
C Language
C++ Quiz
C++-new and delete
new and delete
C++ | Inheritance | Question 2
Last Updated: 28 June 2021
Output?[sourcecode language="CPP"]#include iostream using namespace std;class Base1 { public: ~Base1() { cout Base1's destructor en
...read more
C Language
C++ Quiz
C++-Inheritance
Inheritance
C++ | Constructors | Question 14
Last Updated: 28 June 2021
Which of the following is true about constructors.1) They cannot be virtual.2) They cannot be private.3) They are automatically called by ne
...read more
C Language
C++-Constructors
Constructors
C++ Quiz
C++ | new and delete | Question 2
Last Updated: 28 June 2021
Which of the following is true about new when compared with malloc.1) new is an operator, malloc is a function2) new calls constructor, mall
...read more
C Language
C++ Quiz
C++-new and delete
new and delete
C++ | const keyword | Question 1
Last Updated: 28 June 2021
Predict the output of following program[sourcecode language="CPP"]#include iostreamusing namespace std;int main(){ const char* p = 12345;
...read more
C Language
C++ Quiz
C++-const keyword
const keyword
C++ | Operator Overloading | Question 3
Last Updated: 28 June 2021
Which of the following operators are overloaded by default by the compiler in every user defined classes even if user has not written?1) Com
...read more
C Language
C++ Quiz
C++-Operator Overloading
Operator Overloading
C++ | Constructors | Question 2
Last Updated: 28 June 2021
When a copy constructor may be called?(A) When an object of the class is returned by value.(B) When an object of the class is passed (to a f
...read more
C Language
C++-Constructors
Constructors
C++ Quiz
C++ | References | Question 1
Last Updated: 28 June 2021
What is the return value of f(p, p) if the value of p is initialized to 5 before the call? Note that the first parameter is passed by refere
...read more
C Language
C++ Quiz
C++-References
References
First
1
2
3
4
5
6
7
8
>>
Last
First
1
2
3
4
5
6
>>
Last
First
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !