Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prime numbers min>max
//gcc 4.9.3 #include <stdio.h> int testprime(int v) { int i; for(i=2;i<v;i++) { if(v%i==0) return 0; } return 1; } int testdigit(int v,int digit) { while(v) { if(v%10==digit) return 1; v/=10; } return 0; } void swap(int *p,int *q) { int t; t=(*p); (*p)=(*q); (*q)=t; return; } main() { unsigned int min=300,max=100,digit=3,data; if(min>max) { swap(&min,&max); } printf("min=%d max=%d ",min,max); for(data=min;data<=max;data++) { if(testprime(data)&&testdigit(data,digit)) printf("%d ",data); } }
run
|
edit
|
history
|
help
0
150109_RecursividadFactorial
8 trajo semal 4
level9
time clock and day count through seconds by ratneshgujarathi
Goodone pointer minus void pointer
merge two dice clay to head sport green globe attacked me seven of prime minister fired
Lab6 v1.1 Sin,cos,tan,cot
B_141118_Euclides
StructSurvey
ACCES FUNC