1. Algoritm nima? Algoritmning xossalari Algoritmni ifodalash usullari turlari


Download 1.4 Mb.
bet3/3
Sana07.05.2023
Hajmi1.4 Mb.
#1437337
1   2   3
Bog'liq
1 AMALIY C dasturlash tili bilan tanishish Chiziqli dasturlar

#include
using namespace std;
int main ()


{
float a,P;
cout<<"a"; cin>> a;
P=4*a;
cout<<"P=" <

system ("pause");
return 0;
}
Begin2. Kvadratningtomoni a berilgan. Uning yuzasi aniqiansin. S=a2
#include
using namespace std;
int main ()

{
int S,a;
cout<<"a="; cin>>a;
S=a*a;
cout<<"S=" <
system ("Pause");
return 0;
}
Begin3. To'g'ri to'rtburchakning tomonlari a va b berilgan. Uning yuzasi S = a * b; va P = 2 * (a + b) perimetri aniqiansin.
#include
using namespace std;
int main ()

{
float a,b,s,p;
cout<<"a=";cin>>a;
cout<<"b=";cin>>b;
s=a*b;
p=2*(a+b);
cout<<"s="<
cout<<"p="<

system("pause");
return 0;
}
Begin4. Aylananing diametri d berilgan. Uning uzunligi aniqiansin L=pi*d. pi = 3.14
#include
using namespace std;
int main ()


{
float p, L,d;
float const pi=3.14;
cout<<"d=";cin>>d;
L=pi*d;
cout<<"L="<
cout<<"p="<

system("pause");
return 0;
}
Begin5. Kubning yon tomoni a berilgan. Uning hajmini V = a3 va to`la sirti S=6*a2 aniqiansin.
#include
using namespace std;
int main ()


{
int a,s,v;
cout<<"a=";cin>>a;
s=6*a*a;
v=a*a*a;
cout<<"s="<
cout<<"v="<
system("pause");
return 0;
}

Uyga vazifa chiziqli dasturga misollar:




Download 1.4 Mb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling