Skip to content

Instantly share code, notes, and snippets.

@savolla
Created October 24, 2018 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save savolla/79e39d036df5db8b2f8802657751a2b6 to your computer and use it in GitHub Desktop.
Save savolla/79e39d036df5db8b2f8802657751a2b6 to your computer and use it in GitHub Desktop.
10'dan 100'e kadar içinde sadece tek rakamların olduğu asal sayıları bastıran program
#include <iostream>
using namespace std;
int asal = 0;
int main(void)
{
for(int a =10; a<=100; a++)
loop_1:
{
if (a%20 == 0)
{
a+=10;
}
for(int b =2; b<=(a-1); b++)
{
if(a%b == 0)
{
a++;
goto loop_1;
}
}
if (a<100)
{
cout << a << ", ";
}
asal++;
}
cout << "\nŞu kadar sayı var " << asal - 1 << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment