Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. Sesión 9: 18/02/2020
  2. 1.
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8.  
  9. namespace Sesion08
  10. {
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. //Declaracion de Variables.
  16. double sumatoria = 0;
  17.  
  18. //Inico el Ciclo For.
  19. for (double n = 1; n <= 100; n++)
  20. {
  21. sumatoria = (1 / n) + sumatoria;
  22. Console.WriteLine(n + "" + sumatoria);
  23. }
  24. }
  25. }
  26. }
  27.  
  28. 2.
  29. using System;
  30. using System.Collections.Generic;
  31. using System.Linq;
  32. using System.Text;
  33. using System.Threading.Tasks;
  34.  
  35. namespace Sesion08
  36. {
  37. class Program
  38. {
  39. static void Main(string[] args)
  40. {
  41. //Declaracion de Variables.
  42. double sumatoria = 0;
  43.  
  44. //Inico el Ciclo For.
  45. for (double n = 0; n <= 100; n++)
  46. {
  47. sumatoria = (Math.Pow(-1,n) / (n + 1)) + sumatoria;
  48. Console.WriteLine(n + "" + sumatoria);
  49. }
  50. }
  51. }
  52. }
  53. 3.
  54. using System;
  55. using System.Collections.Generic;
  56. using System.Linq;
  57. using System.Text;
  58. using System.Threading.Tasks;
  59.  
  60. namespace Sesion08
  61. {
  62. class Program
  63. {
  64. static void Main(string[] args)
  65. {
  66. //Declaracion de Variables.
  67. double sumatoria = 0;
  68.  
  69. //Inico el Ciclo For.
  70. for (double n = 0; n <= 100; n++)
  71. {
  72. sumatoria = (1 / Math.Pow(2,n)) + sumatoria;
  73. Console.WriteLine(n + "" + sumatoria);
  74. }
  75. }
  76. }
  77. }
  78.  
  79. 4.
  80. using System;
  81. using System.Collections.Generic;
  82. using System.Linq;
  83. using System.Text;
  84. using System.Threading.Tasks;
  85.  
  86. namespace Sesion08
  87. {
  88. class Program
  89. {
  90. static void Main(string[] args)
  91. {
  92. //Declaracion de Variables.
  93. double sumatoria = 0, x;
  94.  
  95. //Pedimos el Valor para x.
  96. Console.WriteLine("Dame el Valor de x: ");
  97. x = double.Parse(Console.ReadLine());
  98.  
  99. //Inico el Ciclo For.
  100. for (double n = 0; n <= 100; n++)
  101. {
  102. sumatoria = (1 / Math.Pow(x,n)) + sumatoria;
  103. Console.WriteLine(n + "" + sumatoria);
  104. }
  105. }
  106. }
  107. }
  108.  
  109. 5.
  110. using System;
  111. using System.Collections.Generic;
  112. using System.Linq;
  113. using System.Text;
  114. using System.Threading.Tasks;
  115.  
  116. namespace Sesion08
  117. {
  118. class Program
  119. {
  120. static void Main(string[] args)
  121. {
  122. //Declaracion de Variables.
  123. double sumatoria = 0;
  124.  
  125. //Inico el Ciclo For.
  126. for (double n = 0; n <= 100; n++)
  127. {
  128. sumatoria = (Math.Pow(-1, n) / Math.Pow(2,n)) + sumatoria;
  129. Console.WriteLine(n + "" + sumatoria);
  130. }
  131. }
  132. }
  133. }
  134. 6.
  135. using System;
  136. using System.Collections.Generic;
  137. using System.Linq;
  138. using System.Text;
  139. using System.Threading.Tasks;
  140.  
  141. namespace Sesion08
  142. {
  143. class Program
  144. {
  145. static void Main(string[] args)
  146. {
  147. //Declaracion de Variables.
  148. double sumatoria = 0, x;
  149.  
  150. //Pedimos el Valor para x.
  151. Console.WriteLine("Cuanto vale x: ");
  152. x = double.Parse(Console.ReadLine());
  153.  
  154. //Inico el Ciclo For.
  155. for (double n = 0; n <= 100; n++)
  156. {
  157. sumatoria = (Math.Pow(-1, n) / Math.Pow(x,n)) + sumatoria;
  158. Console.WriteLine(n + "" + sumatoria);
  159. }
  160. }
  161. }
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement