Write program input a number and check prime or not also check perfect or not
Answers
Answered by
0
Answer:
int main(){
int a,i;
cin>>a>>endl;
for(i=2;i<a;i++)
{
if(a%i==0){
cout<<"not prime"<<endl;
break;
}
}
if(i==a){
cout<<"prime"<<endl;
}
Answered by
0
This program will help you.
THANK YOU,
THANK YOU,IF IT HELPED YOU THEN MARK IT AS
THE BRAINLIEST ONE.
Attachments:
Similar questions
English,
1 month ago
Computer Science,
2 months ago
Math,
2 months ago
Science,
9 months ago
Math,
9 months ago
Accountancy,
9 months ago