C++ Basics 1
C++ Basics 1
C++ Basics 1
(Part 1)
Srivaths P
Why you should prefer C++
(For Competitive Programming)
#include <iostream>
using namespace std;
int main() {
cout << "Hello world!" << endl;
}
Constants in C++
• Integer constants: 4 | 62 | -90
1. +
2. -
3. ++
4. --
Input in C++
To input a value, we use the cin operator as
follows: cin >> value;
Conditional operators:
==, !=
Relational operators:
<, >, <=, >=
Logical operators
Logical operators perform operations on boolean values or
expressions that result in Boolean values.
Syntax: if (condition) {
// something
} else if (another_condition) {
// something
} else {
// something
}
Scope
A scope is a region of the program.
0-17 : Child
18-64 : Adult
65+ : Senior Citizen
0-35 : F
35-50 : E
50-60 : D
60-70 : C
70-85 : B
85-100 : A
• https://forms.gle/p2DtZzQuQ2xmutae8
Please fill the feedback form!
https://forms.gle/p2DtZzQuQ2xmutae8
Thank you!