Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <iostream>
- #define PI 3.141592
- using namespace std;
- void fkonus(float r1, float r2, float h, float *s, float *v)
- {
- *v = PI*h*(r1*r1 + r1*r2 + r2*r2)/3;
- *s = PI*r2*r2;
- }
- int main() {
- setlocale(LC_ALL, "Bulgarian");
- float r1, r2, s, v, h;
- cout << "Vavedete radiusa na dolnata osnova:"; cin >> r1;
- cout << "Vavedete radiusa na gornata osnova:"; cin >> r2;
- cout << "Vavedete visochina na konusa:"; cin >> h;
- fkonus(r1, r2, h, &s, &v);
- cout << endl << "Obema na konusa e:"; printf("%.2f\n", v);
- cout << "Liceto na konusa e:"; printf("%.2f\n", s); cout << endl;
- cout << endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement