# As from main transfer int to function

• How do you transfer the main N values to function?

``````
int prime(const int N , int argc, char argv[]) {
int sieve[N] = { 0 }; // создаю массив размером N вставляя 0
int a_max = 0; // вывод макс числа
for (int i = 2; i * i &lt; N; ++i)
for (int k = i * i; k &lt; N; k += i)
sieve[k] = 1; // если не подходит, то ставится 1

printf("Prime numbers:\n");
for (int i = 2; i &lt; N; ++i)
if (sieve[i] == 0)
printf("%d\n", a_max = i); // а второй массив пишет числа если оно равно 0

}
int main() {
int N;
scanf_s("%d", &N);
prime(N);
}
``````

• Start reading. https://ru.stackoverflow.com/help/how-to-ask ♪ Judging by your absence, you haven't even read the first page of the website... The more detailed and the big "I need!" you ask a question, the less chance of a normal answer.

You're just saying, "the program isn't compiling." How are you not compiling? What compilator? What does he say? Isn't that our dog business?

Just to close these misery, keep the program.

``````#include <stdio.h>
#include <stdlib.h>
void prime(int N)
{
unsigned char * sieve = malloc(N+1);
for(int i = 0; i <= N; ++i) sieve[i] = 1-i%2;
sieve[0] = sieve[1] = 1; sieve[2] = 0;
for (int i = 3; i * i <= N; i += 2)
for(int k = 2*i; k <= N; k += i) sieve[k] = 1;
printf("Prime numbers:\n");
for (int i = 2; i &lt;= N; ++i)
if (sieve[i] == 0)
printf("%d\n", i);
free(sieve);

}
int main() {
int N;
scanf_s("%d", &N);
prime(N);
}
``````

Right here-- https://ideone.com/jlJCdf - Her job is to take another "I can't."

2

2

2

2

2

2

2

2

2

2

2

2

2

2

2