Guest User

Untitled

a guest
Oct 19th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4. int n1,n2,i,r1,r2;
  5. long long p;
  6. int main(){
  7. cin>>n1>>n2;
  8. cout<<"square root of n1: "<<sqrt(n1)<<"\n";
  9. cout<<"square root of n2: "<<sqrt(n2)<<"\n";
  10. p=1;
  11. for(i=1;i<=n2;i++)
  12. p=p*n1;
  13. cout<<"n1 to the power of n2: "<<p<<"\n";
  14. r1=0;
  15. while(n1!=0){
  16. r1=r1*10+n1%10;
  17. n1=n1/10;
  18. }
  19. cout<<"n1 inversed: "<<r1<<"\n";
  20. r2=0;
  21. while(n2!=0){
  22. r2=r2*10+n2%10;
  23. n2=n2/10;
  24. }
  25. cout<<"n2 inversed: "<<r2<<"\n";
  26. return 0;
  27. }
Add Comment
Please, Sign In to add comment