



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
computer science data structure
Typology: Exercises
1 / 7
This page cannot be seen from the preview
Don't miss anything!




#include
cout<<"enter the prime number"; cin>>n; for(int i=2;i<n;i++) { if(n%i==0) {
status=0; } millisec++; }
if(status) { cout<<"is prime # "<<"and"<<endl; cout<<"time ="<<millisec; }
else{
cout<<"not a prime # "<<"and"<<endl; cout<<"time ="<<millisec; } return 0; system("pause"); } v
#include
return 0; system("pause"); }
Co
cout<<"is prime # "<<"and"<<endl; cout<<"time ="<<millisec; } else{
cout<<"not a prime # "<<"and"<<endl; cout<<"time ="<<millisec; } return 0; system("pause");