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]; } } } }

20th May 2022, 2:13 PM
ashii
2 odpowiedzi