Basic ProgrammingWorkshop Day 1
Basic ProgrammingWorkshop Day 1
DAY 1
TOPICS TO BE COVERED
● Day 1 :
○ Basic Introduction
○ Variables
○ Arithmetic Operators
○ Header Files
○ Input and Output in C++
○ String
○ Conditional Statements
○ Loops
Types of programming languages:
1. C++
2. Java
3. Python etc…
C++ Variables
Variables are containers for storing data values.
In C++, there are different types of variables (defined with different keywords), for example:
● int - stores integers (whole numbers), without decimals, such as 123 or -123
● double - stores floating point numbers, with decimals, such as 19.99 or -19.99
● char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes
● string - stores text, such as "Hello World". String values are surrounded by double quotes
● bool - stores values with two states: true or false
● Double - Stores fractional numbers, containing one or more decimals. Sufficient for storing 15 decimal digits
Overflow
- int , long int, long long
Underflow
- signed and unsigned
Arithmetic Operators
Pre and post increment/decrement
All of these streams are defined inside the <iostream> header file which contains all the standard input and
output tools of C++. The two instances cout and cin of iostream class are used very often for printing outputs and
taking inputs respectively. These two are the most basic methods of taking input and printing output in C++.