0
hi can someone help am trying to make a progam that will ask user how many number and it will also list the prime number
and composite number so far this is the code for user to input the numbers (sorry for my bad english) using System; public class Program { public static void Main() { //1 Console.WriteLine("How many numbers? :"); int size = int.Parse(Console.ReadLine()); //2 int[] arr = new int[size]; //3 for (int i = 0; i < size; i++) { Console.WriteLine("Enter number " + i + " : "); arr[i] = int.Parse(Console.ReadLine()); } //4 int largest = arr[0]; int smallest = arr[0]; //5 for (int i = 1; i < size; i++) { if (arr[i] > largest) { largest = arr[i]; } if (arr[i] < smallest) { smallest = arr[i]; } } } }
2 Réponses
+ 1
https://code.sololearn.com/cRs8fYLzPE21/?ref=app
https://code.sololearn.com/c2IsW5UqV958/?ref=app
https://code.sololearn.com/cw44d2kIuskc/?ref=app
https://code.sololearn.com/cH99P3gR2xlU/?ref=app
https://code.sololearn.com/chIeT1xGlE0t/?ref=app
https://code.sololearn.com/cOtndS4KDivE/?ref=app
https://code.sololearn.com/cb9hZQBMUXJx/?ref=app