Alıştırmalar Döngüler//
1.0 ile 10 arsındaki çift sayıları alt alta yazdırma..
#include<iostream>
using namespace std;
void main()
{ int a;
for(a=0;a<=10;a=a+2)
{if(a==10)continue; cout<<a<<endl;}
}
#include<iostream>
using namespace std;
void main()
{int a,n;
bas: cout<<"n degerini gir: ";cin>>n;
if(n<=0) goto bas;
for(a=0;a<=n;a=a+2)
cout<<a<<"\t";
}
#include<iostream>
using namespace std;
void main()
{int a,n,top=0;
bas:cout<<"n degerini gir: ";cin>>n;
if(n<=0) goto bas;
for(a=0;a<=n;a=a+2)
{top=top+a;}
cout<<"toplam= "<<top<<endl;
}
#include<iostream>
using namespace std;
void main()
{int a,top=0;
for(a=0;a<=10;a++)
{ if(a==5) continue;
top=top+a;}
cout<<top<<endl;
}
#include<iostream>
using namespace std;
void main()
{int x,sayi;double top=0;
for(x=1;x<=5;x++)
{cout<<x<<". sayiyi giriniz ";cin>>sayi;
top=top+sayi;}
cout<<"ortalama = "<<top/5<<endl;
}
#include<iostream>
using namespace std;
void main()
{int a,b,x;
for(b=1;b<=10;b++)
{ for(a=1;a<=10;a++)
{x=2*a-b;
cout<<"b= "<<b<<"\t"<<"a= "<<a<<"\t"<<"x= "<<x<<endl;
}}
}
#include<iostream>
using namespace std;
void main()
{double alan,cevre,r,pi=3.1419;
for(r=1;r<=10;r++)
{alan=r*pi*r;
cevre=2*pi*r;
cout<<"alan = "<<alan<<"\t"<<"cevre = "<<cevre<<"\t"<<"yarı cap = "<<r<<endl;}
}
////////////
#include<iostream>
using namespace std;
void main()
{double a,f;
for(a=0;a<=100;a=a+100)
{f=(a*10/18)+32;
cout<<"fahrenhayt= "<<f<<endl;
}
}
baslangıc ,bitiş değerlerini ve artış miktarını kullanıcıdan isteyen ve değerler arasında kalan sayıları yazan program..
#include<iostream>
using namespace std;
void main()
{double bas,son,artıs;
don: cout<<"baslangıc degerini gir";cin>>bas;
cout<<"bitis degerini gir";cin>>son; if(son<=bas) goto don;
cout<<"artıs miktarını gir";cin>>artıs;
for(bas;bas<son;bas=bas+artıs)
cout<<bas<<endl;
}
#include<iostream>
using namespace std;
void main()
{int a,b,carpım;
for(a=1;a<=10;a++)
{ for(b=1;b<=10;b++)
{ carpım=a*b;
cout<<"a= "<<a<<" b= "<<b<<" carpim= "<<carpım<<"\n";
}
}}
#include<iostream>
using namespace std;
void main()
{ int x,y,top=0;
cout<<"x degerini gir:";cin>>x;
cout<<"y degerini gir:";cin>>y;
if (x>y)
{for(++y;y<x;y++)
top=top+y;
cout<<"toplam= "<<top<<endl; }
else if(x==y)
{cout<<top<<endl;}
else
{for(++x;x<y;x++)
top=top+x;
cout<<"toplam= "<<top<<endl;
}}
ASAl sayi mi?
#include<iostream>
using namespace std;
void main()
{int n,sonuc=1,sayac=2;
cout<<"sayi gir:";cin>>n;
for(;sayac<n;sayac++)
{if(n%sayac==0)
{sonuc=0;break;}
}
if(sonuc==1)cout<<"asal sayi";else cout<<"asal sayi degil";
}
TEN TINOHI - Titanium-Argentine Tilt - Stainless Steel Tilt - Titsin.
YanıtlaSilTEN TINOHI. We are citizen super titanium armor currently in hypoallergenic titanium earrings production at the Terti Lake Superior Resort. Our ford edge titanium 2019 new stainless steel and steel iron titanium token top quality stainless snow peak titanium flask steel $2.49 · In stock
y253e2ygcss065 wholesale jerseys,cheap jerseys,nfl jerseys,wholesale jerseys,wholesale nfl jerseys,Cheap Jerseys china,wholesale jerseys,cheap jerseys,wholesale jerseys from china,cheap nfl jerseys u564w9utgte922
YanıtlaSil