Created
June 26, 2019 08:30
-
-
Save Flid/d9ac7170c5b42d721e9661c148f311b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(2, n/2): | |
if not n % 1: | |
flag = 1; | |
break | |
if n == 1: | |
print("1 is neither a prime nor a composite number.") | |
else: | |
if flag == 0: | |
print(f"{n} is a prime number.") | |
else: | |
print(f"{s} is not a prime number.") | |
for(i = 2; i <= n/2; ++i) { | |
if(n%i == 0) { | |
flag = 1; | |
break; | |
} | |
} | |
if (n == 1) { | |
printf("1 is neither a prime nor a composite number."); | |
} | |
else { | |
if (flag == 0) | |
printf("%d is a prime number.", n); | |
} | |
else { | |
printf("%d is not a prime number.", n); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment