Facebook
From Eduardo, 3 Years ago, written in C#.
Embed
Download Paste or View Raw
Hits: 125
  1. You have an array (called myArray) with 5 elements (integers in the range of 1 to 100). Write a program in CTM that prints the highest number of the array (if repeated, only print once). The program should only print the number, without any text.
  2.  
  3. The code that fills the array is already written, but you can edit it to test with other values. With the refresh button you can retrieve the original value that will be used to evaluate the question as correct or incorrect during execution.
  4.  
  5. int mayor = 0;
  6.  
  7.  
  8. for (int i = 0; i < myArray.Length; i++){ if(myArray[i] < 1 || myArray[i]>100 ){
  9. Console.WriteLine("enteros fuera del rango de 1 a 100"); break;
  10. }
  11.  
  12.  
  13.  
  14. if(i > mayor){ mayor= myArray[i];
  15. }
  16.  
  17. }
  18.  
  19. if(mayor > 0){ Console.WriteLine(mayor);
  20. }
  21.  

Replies to Convert from c# to python rss

Title Name Language When
Re: Convert from c# to python Eduardo csharp 3 Years ago.