Skip to main content
Commonmark migration
Source Link

C, 125 bytes

#C, 125 bytes MostMost likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 125 bytes.

c,h,i,j;g(n){for(j=2;j*j<=n;j++)if(n%j<1)return 1;return 0;}main(){scanf("%i",&h);for(i=2;c<h;i++)g(i)?:printf("%i ",i,c++);}

#C, 125 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 125 bytes.

c,h,i,j;g(n){for(j=2;j*j<=n;j++)if(n%j<1)return 1;return 0;}main(){scanf("%i",&h);for(i=2;c<h;i++)g(i)?:printf("%i ",i,c++);}

C, 125 bytes

Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 125 bytes.

c,h,i,j;g(n){for(j=2;j*j<=n;j++)if(n%j<1)return 1;return 0;}main(){scanf("%i",&h);for(i=2;c<h;i++)g(i)?:printf("%i ",i,c++);}
deleted 1 character in body
Source Link

#C, 218125 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 218125 bytes.

#include <stdio.h>
int gc,h,i,j;g(int n){if(n<=1)return 0;int i;forfor(i=2;i*i<=n;i++j=2;j*j<=n;j++){if(n%i==0n%j<1){return 0;}}return1;return 1;0;}main(){int h,i=0,c=0;printf("Output:");scanfscanf("%i",&h);while;for(c!=10i=2;c<h;i++){if(g(i)){?:printf("Prime"%i %i\n"", i,c++);c++;}i++;};}

#C, 218 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 218 bytes.

#include <stdio.h>
int g(int n){if(n<=1)return 0;int i;for(i=2;i*i<=n;i++){if(n%i==0){return 0;}}return 1;}main(){int h,i=0,c=0;printf("Output:");scanf("%i",&h);while(c!=10){if(g(i)){printf("Prime %i\n", i);c++;}i++;}}

#C, 125 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 125 bytes.

c,h,i,j;g(n){for(j=2;j*j<=n;j++)if(n%j<1)return 1;return 0;}main(){scanf("%i",&h);for(i=2;c<h;i++)g(i)?:printf("%i ",i,c++);}
edited body
Source Link

#C, 218 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 432218 bytes.

#include <stdio.h>
int g(int n){if(n<=1)return 0;int i;for(i=2;i*i<=n;i++){if(n%i==0){return 0;}}return 1;}main(){int h,i=0,c=0;printf("Output:");scanf("%i",&h);while(c!=10){if(g(i)){printf("Prime %i\n", i);c++;}i++;}}

#C, 218 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 432 bytes.

#include <stdio.h>
int g(int n){if(n<=1)return 0;int i;for(i=2;i*i<=n;i++){if(n%i==0){return 0;}}return 1;}main(){int h,i=0,c=0;printf("Output:");scanf("%i",&h);while(c!=10){if(g(i)){printf("Prime %i\n", i);c++;}i++;}}

#C, 218 bytes Most likely I'm not going to win against the Jelly solution haha. Anyway here's my solution in C. It's not commented and it's very compact to reduce the size of the program. 218 bytes.

#include <stdio.h>
int g(int n){if(n<=1)return 0;int i;for(i=2;i*i<=n;i++){if(n%i==0){return 0;}}return 1;}main(){int h,i=0,c=0;printf("Output:");scanf("%i",&h);while(c!=10){if(g(i)){printf("Prime %i\n", i);c++;}i++;}}
deleted 342 characters in body
Source Link
Loading
Source Link
Loading