Course Hero Logo

reverse.cpp - #include iostream #include cmath using...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 out of 1 page.

#include<iostream>#include<cmath>using namespace std;int main(){int n;cin>>n;bool flag =0;for(int i=2;i<sqrt(n);i++){if(n%i==0){cout<<"Non Prime"<<endl;
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
N/A
Tags
bool flag, non prime

Unformatted text preview: if(n%i==0){ cout<<"Non Prime"<<endl; flag=1; break; } } if(flag==0){ cout<<"Prime"<<endl; } return 0; }...
View Full Document

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture