Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

Problem of the day

You are given a positive integer 'N'. Your task is to return all the prime numbers less than or equal to the 'N'.

Note:

```
1) A prime number is a number that has only two factors: 1 and the number itself.
2) 1 is not a prime number.
```

Detailed explanation

```
1 <= T <= 100
2 <= N <= 5000
Time Limit: 1sec
```

```
1
5
```

```
2 3 5
```

```
2,3 and 5 are the only prime numbers less than or equal to 5.
```

```
1
8
```

```
2 3 5 7
```

```
2,3,5 and 7 are the only prime numbers less than or equal to 8.
```