Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. {
  2.  
  3. read_char();//read number
  4. d1=d0;
  5. read_char();
  6. d2=d0;
  7. read_char();
  8. d3=d0;
  9.  
  10. //computation
  11.  
  12. d4=0;
  13. d4=d4+d1;
  14. d4=d4+d2;
  15. d4=d4+d3;//d4 is now x
  16.  
  17. d5=0;
  18. d5=1000;//d5 is now the numerator of the fraction (1000)
  19.  
  20. d4=1+d4;//d4 is now the denominator of the fraction (1+x)
  21.  
  22. d5=d5/d4;//d5 is now the quotient of d5/d4, and the whole inside of the brackets of our equation
  23.  
  24. d5=d5-1;//the last arithmetic operation, d5 is now our result (y)
  25.  
  26. //make d1,d2,d3 = digits of d5, d5 represented in binary.
  27. d1=d5%10;
  28. d5=d5/10;
  29. d2=d5%10;
  30. d5=d5/10;
  31. d3=d5%10;
  32.  
  33.  
  34. d0=13;
  35. write_char();//carriage return
  36. d0=10;
  37. write_char();//line feed
  38. d0=d3;
  39. write_char();//write y
  40. d0=d2;
  41. write_char();
  42. d0=d1;
  43. write_char();
  44.  
  45.  
  46.  
  47. return 0; // exit
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement