This is my school assignment.

**Problem Statement:**

> 
> "Write a program to print the prime numbers from 1 to 100.(A prime integer is any integer that can be divided evenly only by itself and 1).
> 
> 
> Requirement: Use an array to take the number from 1 to 100 and another array to take the prime number."
> 
> 
> 

Here's my code:

```
#include <stdio.h>
int main ()
{
    int x[100], a[100];
    int y, z;
    printf("here is an array going 1-100 :D\n");
    for (y=2; y<=100; y++){
            x[y]=y;
            printf("\n%d\n", x[y]);
            for (z=2; z<=y; z++){
                a[z]=z;
                if (a[z]%z==0){
                    break;
                }
            }
            if (z==a[z]){
               printf("\n%d is a prime number\n", a[z]);
            }
        }

    return 0;
}

```

I've been stumped on this for a bit. I've googled the question which usually solves my problem. But, I feel I'm close. Just having some trouble on my second array I believe.

Kindly guide me.