Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
check Prime
#include <iostream> using namespace std; int main() { int num,i; cin>>num; if(num==0 || num == 1) cout<<"The smallest number is 2"; for(i = 2; i < num; i++) if(num%i==0) { cout<<"Not prime"; break; } if(num == i) cout<<"prime"; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
BintTree vertical sum
Dictionary
Maximum product subarray
decomposition
SayHi
remove_if_30-Seconds-of-C++
2018JanSilv2
Minimum Vertices to Traverse Directed Graph
Merge overlapping time intervals
SpiralMatrix
stackse - search stackoverflow differently
Please log in to post a comment.