Skip to content

Instantly share code, notes, and snippets.

Created February 25, 2018 20:00
Show Gist options
  • Save anonymous/cd3fb9c0e5ebe1d0546724ffd540a7ab to your computer and use it in GitHub Desktop.
Save anonymous/cd3fb9c0e5ebe1d0546724ffd540a7ab to your computer and use it in GitHub Desktop.
PerfectMellowDigits created by Divyanshu29 - https://repl.it/@Divyanshu29/PerfectMellowDigits
#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