-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathB1dataTypes.cpp
22 lines (18 loc) · 1.3 KB
/
B1dataTypes.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
int main(){
int x; // int - integer, x is the Variable.
x = 10; // x =5 variable x value is 5.
int y = 20; // Other way to specify int.
float z = 50.25; // float is always in decimals like 10.5 or 20.13
double m = 100.60; // double is used for big value to store
char a = 65; // char is user to store single Characters like A - Z starts from 65 to 128 - ASCII chart
std::string name = "wizard"; // string holds the charaters in sequence.
const double PI = 3.14159; // When you specify const the Value cannot be changed of Variable.
// Const should be more often use if needed for better program
std::cout<<x <<std::endl; //we can ignore STD:: with a short trick if you need.
std::cout<<y <<std::endl; //in next program you can see how
std::cout<<z <<std::endl;
std::cout<<m <<std::endl;
std::cout<<a <<std::endl;
return 0;
}