y=y+(1/i*i*i);
}
cout<return 0;
}
17.Raqam yozsa hafta kunlarini chiqaradigan dastur tuzing.
#include
using namespace std;
int main()
{
int n;
cin>>n;
switch (n){
case 1 : cout<<"dushanba";break;
case 2 : cout<<"seshanba";break;
case 3 : cout<<"chorshanba";break;
case 4 : cout<<"payshanba";break;
case 5 : cout<<"juma";break;
case 6 : cout<<"shanba";break;
case 7 : cout<<"yakshanba";
}
return 0;
}
18.k ni n marta chiqaradigan dastur tuzing.
#include
using namespace std;
int main()
{
int n,k;
cin>>k>>n;
for(int i=1; i
cout<
}
return 0;
}
19.a ni b ga bolgandagi qoldiqni toping.
#include
using namespace std;
int main()
{
int a,b,q;
cin>>a>>b;
q=a;
while(q>=0){
q=q-b;
}
cout<
return 0;
}
20.Baholarni sifatiga moslashtiring.
#include
using namespace std;
int main()
{
int n;
cin>>n;
switch (n){
case 1 : cout<<"yomon";break;
case 2 : cout<<"qoniqarsiz";break;
case 3 : cout<<"qoniqarli";break;
case 4 : cout<<"yomon";break;
case 5 : cout<<"alo";break;
default : cout<<"xato";
}
return 0;
}