-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVARIABLE.CPP
More file actions
85 lines (68 loc) · 1.83 KB
/
VARIABLE.CPP
File metadata and controls
85 lines (68 loc) · 1.83 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//input the side of a square. You have to output the area of the square.
/*#include <iostream>
using namespace std;
int main(){
int n;
cout<<"enter side of a square:";
cin>>n;
cout<<"area of square is:"<<n*n;
return 0;
} */
//Enter cost of 3 items from the user-a pencil,a pen and an eraser.You have to output the total cost of the items back to the user as their bill.
/*#include <iostream>
using namespace std;
int main(){
float pencil,pen,eraser;
int gst=18;
cout<<"enter cost of pencil:";
cin>>pencil;
cout<<"enter cost of pen:";
cin>>pen;
cout<<"enter cost of eraser:";
cin>>eraser;
cout<<"total cost of items is:"<<pencil+pen+eraser<<endl;
cout<<"total cost with GST is:"<<pencil+pen+eraser+(pencil+pen+eraser)*gst/100<<endl;
return 0;
}*/
//Build a Simple Interest Calculator.
/*#include <iostream>
using namespace std;
int main(){
float p,r,t;
cout<<"enter principal amount:";
cin>>p;
cout<<"enter rate of interest:";
cin>>r;
cout<<"enter time in years:";
cin>>t;
cout<<"simple interest is:"<<p*r*t/100<<endl;
cout<<"total amount is:"<<p+p*r*t/100<<endl;
return 0;
}*/
//Write a program to convert temperature from Celsius to Fahrenheit and vice versa.
/*#include <iostream>
using namespace std;
int main(){
float c,f;
cout<<"enter temperature in celsius:";
cin>>c;
f=(c*9/5)+32;
cout<<"temperature in fahrenheit is:"<<f<<endl;
cout<<"enter temperature in fahrenheit:";
cin>>f;
c=(f-32)*5/9;
cout<<"temperature in celsius is:"<<c<<endl;
return 0;
}*/
//Write a program to calculate the area of a circle.
/*#include <iostream>
using namespace std;
int main(){
float r,area;
float pi=3.14;
cout<<"enter radius of circle:";
cin>>r;
area=pi*r*r;
cout<<"area of circle is:"<<area<<endl;
return 0;
}*/