Guest User

Untitled

a guest
Dec 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. // TestForChris.cpp : main project file.
  2.  
  3. #include <iostream>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. int Ntimes(int N)
  9. {
  10. int count;
  11. count = 0;
  12. do
  13. {
  14. if (N % 2 == 0)
  15. {
  16. N = N/2;
  17.  
  18. }
  19. else
  20. {
  21. N = N*3 + 1;
  22.  
  23. }
  24. count++;
  25. }
  26. while (N!=1);
  27. return count;
  28. }
  29.  
  30. int main(array<system::String ^> ^args);
  31. {
  32. int N;
  33. cout << "Enter Input: ";
  34. cin >> (N);
  35. cout<<(N*(N));
  36. system("Pause");
  37. return 0;
  38. }
Add Comment
Please, Sign In to add comment