Visual C++: Afficher la liste des nombres premiers

Author:


{filelink=13221}

// MesExemples3.cpp : 

#include "stdafx.h"
using namespace System;

Int32 main(void)
{
// Afficher les nombres premiers moins de 100
	for (Int32 i = 1; i  1)
			continue;
		else if ( i % 3 == 0 && i / 3 > 1)
		  continue;
		else if ( i % 5 == 0 && i / 5 > 1)
		    continue;
		else if ( i % 7 == 0 && i / 7>1)
			continue;
		Console::WriteLine(i);
	}



	Console::ReadLine();

    return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *