Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. 1/2 = 0.5
  2. 0.5 / 2 = 0.25
  3.  
  4. static void Main(string[] args)
  5. {
  6. int i = 0;
  7. decimal x = 1m;
  8. decimal dividir = x / 2m;
  9. do
  10. {
  11. i++;
  12. Console.WriteLine("{0}:{1}", i, dividir);
  13. dividir = dividir / 2m;
  14.  
  15. } while (dividir != 0);
  16. Console.ReadKey();
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement