Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. static void Main(string[] args)
  3. {
  4. List<int> listaA = new List<int>();
  5. listaA.Add(22);
  6. listaA.Add(4);
  7.  
  8. Class1.Suma15(listaA);
  9. }
  10.  
  11. class Class1
  12. {
  13. public static void Suma15(List<int> listaX)
  14. {
  15. int suma = 0;
  16. for (int x = 0; x < listaX.Count; x++)
  17. {
  18. suma += listaX[x];
  19. Console.WriteLine("listaX" + suma);
  20. }
  21.  
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement