#include<iostream.h>
#include<conio.h>
void main()
{
int n;
clrscr();
cout<<"Enter the number:";
cin>>n;
int x=n*n;
int y=x+17;
int z=y%12;
if(z==6)
{
cout<<"Prime Number";
}
else
{
cout<<"Not a Prime Number";
}
getch();
}
#include<conio.h>
void main()
{
int n;
clrscr();
cout<<"Enter the number:";
cin>>n;
int x=n*n;
int y=x+17;
int z=y%12;
if(z==6)
{
cout<<"Prime Number";
}
else
{
cout<<"Not a Prime Number";
}
getch();
}
No comments:
Post a Comment