File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1+ #Prime numbers
12#52- Write a program that reads an integer and tells whether or not it is a prime number.
23number = int (input ('Enter a integer number:' ))
34tot = 0
1213if tot == 2 :
1314 print ('And that is why he is a prime number.' )
1415else :
15- print ('And that is why it is not a prime number.' )
16+ print ('And that is why it is not a prime number.' )
17+
18+
19+ #Números primos
20+ #52: Faça um programa que leia um número inteiro e diga se ele é ou não um número primo.
21+ numero = int (input ('Digite um número:' ))
22+ total = 0
23+ for contador in range (1 ,numero ,+ 1 ):
24+ if numero % contador == 0 :
25+ print (end = '' )
26+ total += 1
27+ else :
28+ print (end = '' )
29+ if total == 2 :
30+ print ('O número é primo.' )
31+ else :
32+ print ('O número é impar.' )
33+
34+ # PT- Estruturas de repetições: For.
35+ # EN- Loop structures: For.
You can’t perform that action at this time.
0 commit comments