Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prime numbers using functions
//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; } main() { unsigned int min=300,max=500,digit=1,data; for(data=min;data<=max;data++) { if(testprime(data)&&testdigit(data,digit)) printf("%d ",data); } }
run
|
edit
|
history
|
help
0
C_141211_OrdenarArrayConFunciones
pth_trap.c
union behaviour when const obj created
shapes and such
Matrix multiplication. C
2 size mas
Type struct
Spring 2017 Project 2 v1.1
to find a number is even or not
18BCE2182 ASSESS_1 Q2-2