1-masala
#include
#include
// Yarasheva Matluba 710-19 gruh tala
using namespace std;
int main()
{
int n;
cout << "Son Kiriting = "; cin >> n;
cout << n << " gacha bo'lgan TUB sonlar :" << endl;
for (int i = 2; i <= n; i++)
{
bool tub = true;
for (int j = 2; j <= sqrt(i); j++)
{
if (i % j == 0)
{
tub = false;
break;
}
}
if (tub == true)
cout << i << endl;
}
return 0;
}
Rasm-1
2-masala
Do'stlaringiz bilan baham: |