Array-promo

Question

Print prime number in an (array in Java/ list in Python).

				
					Prime number is a number that is greater than 1 and divided by 1 or itself only. In other words, prime numbers can't be divided by other numbers than itself or 1. For example 2, 3, 5, 7, 11, 13, 17.... are the prime numbers.
				
			
				
					Enter size of list:10
Enter elements in list:
1:10
2:13
3:14
4:-10
5:-13
6:1
7:98
8:23
9:24
10:2
Elements entered in given List:
[10, 13, 14, -10, -13, 1, 98, 23, 24, 2]
Prime numbers in given list:
13 23 2 
				
			

Share code with your friends

Share on whatsapp
Share on facebook
Share on twitter
Share on telegram

Code

Coding Store

10-minute Stress-Buster Games

Leave a Reply

Your email address will not be published. Required fields are marked *