C++ is a general-purpose programming language created by Bjarne Stroustrup. It is an extension of the C language and supports both procedural and object-oriented programming.
C++ is widely used for:
System software (operating systems, drivers)
Game development ????
Desktop applications
Embedded systems
High-performance applications
Fast and efficient
Object-Oriented (classes, objects, inheritance)
Low-level memory control (using pointers)
Portable (can run on different platforms)
Rich Standard Library
#include → Allows input/output operations
using namespace std; → Avoids writing std:: repeatedly
int main() → Entry point of the program
cout → Used to print output
return 0; → Ends the program successfully
cin → Input from user
cout → Output to screen
Common data types in C++:
| Type | Example |
|---|---|
| int | 10 |
| float | 3.14 |
| double | 3.14159 |
| char | 'A' |
| bool | true / false |
| string | "Hello" |
Example:
For Loop
While Loop
Functions help divide programs into smaller, reusable parts.
Foundation for learning other languages
Used in competitive programming
Powerful for performance-critical applications
Strong understanding of memory and system design
Take quizzes related to this topic and see where you stand!
Start Quiz Now