neogz

~F - Kub broja

Dec 14th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. float kub(float x);
  6.  
  7. int main() {
  8.    
  9.     float broj, rezultatKuba;
  10.  
  11.     cout << "Unesi jedan broj: ";
  12.     cin >> broj;
  13.  
  14.     rezultatKuba = kub(broj);
  15.     cout << "Vas uneseni broj " << broj << ", kubiran iznosi: " << rezultatKuba << ".";
  16.  
  17.  
  18.     system("pause>nul");
  19.     return 0;
  20. }
  21.  
  22. float kub(float x){
  23.     return x*x*x;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment