Professional Documents
Culture Documents
1 лаб c++ звіт
1 лаб c++ звіт
Код програми
#include <iostream>
#include <iomanip>
#include <cmath>
int main() {
const double pi = 3.14159265;
double radius, height, volume;
// Виведення результату
cout <<right<< "Об'єм циліндра з радіусом " << radius << " і висотою " << height << " дорівнює " << volume << endl;
printf ("%15.4f \n", radius);
printf ("%15.4f \n", height);
printf ("%15.4f \n",volume);
return 0;
}
Результат виконання програми
Контрольні запитання:
2. У функції scanf():
9. Виправлені оператори:
а) cout << "Hello, people!" << endl;
б) scanf(" %f %f", &f1, &f2);
в) printf("Today is the %dth of September %d\n", day, 2021);
г) setw(3); setprecision(3);cout<<t<<endl;
10. cout << "Results: " << 15 << "\t" << 2 << "\t" << 6;