Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
8 deleted 3 characters in body
source | link

C: 115113

n,c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++i+=2)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

Thanks for help from Dennis, bebe, and Alchymist.

C: 115

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

C: 113

n,c,l;main(i){for(scanf("%d",&n),l=2;n;l=c==i?n-=i==l+2,i:l,i+=2)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

Thanks for help from Dennis, bebe, and Alchymist.

7 add language tag
source | link

C: 115

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}
c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

C: 115

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

C: 115

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109
6 Fixed broken code.
source | link

C: 116115

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;for(c=2;c<i&&i%c++;),l=c==il=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

C: 116

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;for(c=2;c<i&&i%c++;),l=c==i?n-=i==l+2,i:l,i++);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109

C: 115

c,l;main(n,i){for(scanf("%d",&n),i=3,l=2;n;l=c==i?n-=i==l+2,i:l,i++)for(c=2;c<i&&i%c++;);printf("%d, %d\n",l-2,l);}

Sample run:

$ for i in $(seq 1 10); do echo $i | ./twinprimes; done
3, 5
5, 7
11, 13
17, 19
29, 31
41, 43
59, 61
71, 73
101, 103
107, 109
5 Got rid of `o`.
source | link
4 deleted 6 characters in body
source | link
3 deleted 79 characters in body
source | link
2 deleted 2 characters in body
source | link
1
source | link