Advertisement
RusSimona

Varianta98 Sub3 Ex3

May 7th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3.  
  4. using namespace std;
  5.  
  6. int numar ( int x, int y)
  7. {
  8. int z;
  9. z=1;
  10. while(z*x<=y)
  11. {
  12. z=z*x;
  13.  
  14. }
  15. return z;
  16. }
  17.  
  18. int main()
  19.  
  20. {
  21. cout<<numar (2, 18);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement