Programalama > C++

Etiketler: asal, sayı, bulan, c++, kodu

Ort. 0
Puan ver:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include<iostream.h>
#include<conio.h>
 
int asalmi(int a)
{
int i;
char asal=''''E'''';
    for(i=2; i<a; i++)
   {
    if((a%i)==0)
      {
      asal=''''H'''';
      break;
      }
   }
   if(asal==''''H'''')return 0;
   if(a==2)return 1;
   if(asal==''''E'''')return 1;
 
}
 
void asal_ara(int a,int b)
{
int i;
for(i=a; i<=b; i++)
{
    if(asalmi(i)==1){cout<<i<<"\t";}
   else continue;
}
}
 
main()
{
int a,b;
cout<<"alt sinir:";
cin>>a;
cout<<"ust sinir:";
cin>>b;
    asal_ara(a,b);
   getch();
}
 
 
 
turan murat guvenc
muratg_5@hotmail.com


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2025 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.