summaryrefslogtreecommitdiff
path: root/BrokenCode/BrokenCode.cpp
blob: 73e5c4485c3f0d15aaf919211055ec78e72446e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// BrokenCode.cpp : This file contains the 'main' function. Program execution begins and ends there.
//This file has one logic and one syntax error

#include <iostream>
using namespace std;

int main()
{
    const double PI = 3.142;
    double radius, height, volume;

    cout << "Input the cylinder's radius: ";
    cin >> radius;
    cout << "Input the cylinder's height: ";
    cin >> height;

    volume = radius * radius * radius * PI * height;
    cout.precision(3);
    cout << fixed << "The volume of a cyliner with radius: " << radius + ", and height: " << height << ", is " << volume;
}