Negmatov Ulug’bek 27-variant ++++++++++


Download 15.21 Kb.
Sana04.06.2020
Hajmi15.21 Kb.
#114448
Bog'liq
oraliqnazorat


Negmatov Ulug’bek 27-variant ++++++++++

1-misol. Foydalanuvchi tomonidan kiritilgan uchta sonning oʻrta arifmetigini ekranga chiqaruvchi dastur tuzing


#include

using namespace std;

int main(float a, float b, float c)

{

float a,b,c,S;



cout<<”ixtiyoriy sonlarni kiriting”<

cout<<”a=”; cin>>a;

cout<<”b=”; cin>>b;

cout<<”c=”; cin>>c;

S=((a+b+c)/3);

cout<<”o’rta arifmetigi “<<”S=”<

system(“pause”);

return 0;

}
2-misol. WHILE siklidan foydalanib y=kx+b, funksiyaning qiymatini x =1, 2, ..., 100 da hisoblang
#include

using namespace std;

int main(float k, float b, float x)

{

float y,b,k;



int x=1;

cout<<”o’zgarmaslarni kiriting ”<

cout<<”k=”; cin>>k;

cout<<”b=”; cin>>b;

while (x<=100)

{

cout<<”y=”<<(k*x+b)<

x++;

}

system(“pause”);



Return 0;

}

Download 15.21 Kb.

Do'stlaringiz bilan baham:




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