-
Notifications
You must be signed in to change notification settings - Fork 0
/
helloworld.cpp
53 lines (37 loc) · 1.08 KB
/
helloworld.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
int main(){
int age=21;
int year=2023;
int days=7.5;
int neel=age+year;
std::cout <<days << std::endl;
std::cout <<year <<std::endl;
std::cout <<neel <<std::endl;
// double(number including decimals)
double price=10.98;
double tempr =25.1;
std::cout << tempr<<"\n";
std::cout <<price <<std::endl;
//char (single letters) can store only one letter
char grade='A';
char curr='$';
std::cout << curr << std::endl;
std::cout<< grade << std::endl;
// boolean(true and false)
bool student=true;
bool forsale=true;
bool power= false;
//string(sentence)
std::string name="Neel";
std::cout<<name<<'\n';
std::string day="sunday";
std::cout <<day << std::endl;
std::string food="spaghetti";
std::cout <<food<<'\n';
std::string address="hamilton park";
std::cout << address<<'\n';
//printing multiple data types
std::cout<<"hello " << name;
std::cout<<" your age is " << age;
return 0;
}