Created
February 25, 2018 20:00
-
-
Save anonymous/cd3fb9c0e5ebe1d0546724ffd540a7ab to your computer and use it in GitHub Desktop.
PerfectMellowDigits created by Divyanshu29 - https://repl.it/@Divyanshu29/PerfectMellowDigits
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
#include<stdio.h> | |
void checkprimenumber(); | |
int main() | |
{ | |
checkprimenumber(); | |
return 0; | |
} | |
void checkprimenumber() | |
{ | |
int i,n,flag; | |
printf("Enter a value of n"); | |
scanf("%d",&n); | |
for(i=2;i<=n/2;++i) | |
{ | |
if(n%i == 0) | |
{ | |
flag = 1; | |
} | |
} | |
if(flag == 1) | |
{ | |
printf("Number is not prime number"); | |
} | |
else | |
{ | |
printf("Number is prime number"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment