-
Hajipur, Bihar, 844101
C++ is a powerful, high-performance object-oriented programming language. It is an extension of C, developed by Bjarne Stroustrup at Bell Labs in the early 1980s.
It supports:
Procedural and object-oriented programming
Low-level memory manipulation
System-level and application-level development
Combines the power of C with modern object-oriented features
Used in game development, operating systems, browsers, and more
Highly efficient and fast
Rich library support and portability
Foundation for many competitive programming problems
Object-Oriented (supports classes, objects, inheritance, etc.)
Statically typed and compiled language
High performance
Supports both procedural and object-oriented paradigms
Allows low-level manipulation via pointers
A C++ compiler like g++
An IDE or text editor (Code::Blocks, VS Code, etc.)
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0;
}
#include <iostream>
— Header for input/output
using namespace std;
— Avoids prefixing std:: with functions like cout
main()
— Program execution starts here
cout
— Outputs to the console
return 0;
— Ends the program
g++ program.cpp -o program
./program
Q1. Print your name in C++
Q2. Add two numbers.
Q3. Use comments in a C++ program.
Q4. Input and output a number.
Q5. Multiply two floating-point numbers.
Q1: Who developed C++?
Q2: What is the correct syntax to output text in C++?
Q3: Which of the following is a correct C++ comment?
Q4: What is the file extension of a C++ source file?
Q5: What is the use of #include <iostream>?