my programme is suppost to print in the screen all the prime numbers smaller than the one i enter in the command line. but there are numbers missing or appering wrong ( if I enter 11 are appearing 5, 7 and 9 when should be 2, 3, 5, 7, 11).
Note:a prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself.To check whether a given number is prime, rather than generate a list of primes given a number n, one divides n by all numbers m less than or equal to the square root of that number. If any of the divisions come out as an integer, then the original number is not a prime. Otherwise, it is a prime.
#include <iostream>
#include<cmath>
using namespace std;
bool primo (int n);
int main(int argc, char* argv[])
{
int m, aux,duv;
if (argc<2)
cout<< "Write a number in the command line" << endl;
else
{
m=atoi(argv[1]);
for(aux=1; aux <m; aux++)
{
duv=primo(aux);
if (duv == 1)
cout << aux<< endl;