31 Oca 2012 @ 8:59 PM 
 

100-150 arasındaki a)Tek sayıların toplamını b)Çift sayıların toplamını c)Asal sayıların toplamını d)Tüm sayıların toplamını bulan program.

 

uses crt;
var
asal,k,a,b,c,i,j:integer;
begin
clrscr;
for i:=100 to 150 do begin
a:=a+i;
if (i mod 2 =0) then
b:=b+i
else
c:=c+i;
for j:=1 to i do begin
if (i mod j=0) then
asal:=asal+1;
if asal=3 then
break;
end;
if asal=2 then    begin
k:=k+1;
gotoxy(54,k+5);
writeln(i);
end;
asal:=0;
end;
gotoxy(5,1);
writeln( ‘Tek sayıların toplamı : ‘,c);
gotoxy(5,3);
writeln( ‘Çift sayıların toplamı: ‘,b);
gotoxy(5,5);
writeln( ‘Tüm sayıların toplamı : ‘,a);
gotoxy(40,5);
writeln(‘ *********Asal Sayılar******** ‘);
readkey;
end.

Tags Kategori: Pascal Programlama Konu Sahibi: NIKIMLOSAC
En son düzenleme: 31 Oca 2012 @ 08 59 PM

EmailPermalink
 

Responses to this post » (None)

 

Post a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

\/ More Options ...
Change Theme...
  • Users » 1
  • Posts/Pages » 310
  • Comments » 5
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

Pascal Örnekleri



  • No Child Pages.

Wp eklenti listesi



  • No Child Pages.