Which is the correct function name for overloading the addition (+) operator in C++?
Asked in APPSC (Arunachal) Question Booklet (Set-A) of Paper I and Paper II 2026
Show answer
Answer: B. Operator+
More APPSC Prelims previous year questions questions
- What will be the output for the following C program? #include<stdio.h> void func() { int x=0; x++; printf("%d", x); } int main() { func(); func(); func(); func(); } Choose the correct option.
- What will be the output of the following C code? #include <stdio.h> int main() { int arr[] = {1, 2, 3, 4, 5, 6}; int i; int key = 5; int size = 6; for (i = 0; i < size; i++) { if (arr[i] == key) { printf("Element found at position: %d", i); break; } } return 0; } Choose the correct option.
- In which block should C++ code that may cause abnormal termination or exceptions be written?
- Which of the following statements is incorrect about function overriding?
- ____ functions show polymorphism.
- What will be the output of the following C++ code? #include <iostream> using namespace std; class Base { public: Base() { foo(); } virtual void foo() { cout << "Base"; } }; class Derived : public Base { public: void foo() override { cout << "Derived"; } }; int main() { Derived d; return 0; } Choose the correct option.
- What will be the output of the following C++ code? #include <iostream> #include <string> using namespace std; int main() { string s = "abc"; s[1] = s[2]; cout << s; } Choose the correct option.
- Which CSS property is responsible for defining how overlapping elements are stacked?