int main(){ printf("Lucas numbers:\n"); lucas_numbers(100); printf("\nTwin primes:\n"); twin_primes(10); return 0; }
int main(){ int choice; do{ printf("\n\n\n\tM\tE\tN\tU\n\t_\t_\t_\t_ \t\n\tType in [1] for |Lucas Numbers|\n\tType in [2] for |Twin Primes|\n\tType in [0] for |EXIT|\t\n\n\n"); printf("\tEnter your choice: "); scanf("%d",&choice); space(); switch( choice ){ case 1:lucas_sequence(100); break; case 2:twin_primes(); break; case 0: break; default: return 1; } }while(choice != 0); return 0; }
int main() { float x, sum, a1, b1; int i, a, b; do { printf("Enter x, where 0 < x < 1!\n"); printf("Enter x:");scanf("%f", &x); }while(x<0 || x>1); a=3; b=5; sum=0; do { if(twin_primes(a,b)) { a1=a; b1=b; printf("%f %f", a1, b1); sum=(1/a1)+(1/b1); printf("%f", sum); } a=a + 2; b=b + 2; }while(sum>x); printf("The twin primes are: %d, %d\n", a, b); printf("%f", sum); getchar(); getchar(); getchar(); }