Toshmatov Muxtor 29-21 guruh talabasi amali mashg’ulot


Download 232.64 Kb.
Sana14.02.2023
Hajmi232.64 Kb.
#1196532
Bog'liq
Toshmatov Muxtor 1-amaliy mashg\'ulot


Toshmatov Muxtor 029-21 guruh talabasi
1 AMALI MASHG’ULOT
1-topshiriq

Masala.
if, if else operatorlariga doir topshiriqlar



Dastur kodi.
# include
# include
using namespace std;
int main () {
float Y,n,m,d;
cin>>d>>n>>m;
if(d>1) {
Y=pow((n*m*m+d),2);
}
else {
Y=d/(n*n+m*m);
}
cout<<"Y="<return 0;
}


Natijasi



1 AMALI MASHG’ULOT
2 –topshiriq

Masala.
Case21. 1-7 gacha bo’lgan butun sonlar berilgan. Kiritilgan songa mos ravishda hafta kunlarini so’zda ifodalovchi dastur tuzilsin. (1-Dushanba, 2-Seshanba,… hk.


Dastur kodi.
# include
using namespace std;
int main () {
int n;
cin>>n;
switch(n){
case(1): cout<<"Dushanba"<case(2): cout<<"Seshanba"<case(3): cout<<"Chorshanba"<case(4): cout<<"Payshanba"<case(5): cout<<"Juma"<case(6): cout<<"Shanba"<case(7): cout<<"Yakshanba"<default : cout<<" Bunaqa kun "<}
return 0;
}


Natijasi.



Download 232.64 Kb.

Do'stlaringiz bilan baham:




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