ta son berilgan. Nechtasi musbat va nechtasi manfiyligini aniqlovchi dastur tuzing



Download 17,83 Kb.
Sana16.01.2022
Hajmi17,83 Kb.
#378542
Bog'liq
Komilov Javohir dasturlash


O’ZBEKISTON RESPUBLIKASI

OLIY VA O’RTA MAXSUS TA’LIM VAZIRLIGI


MIRZO ULUG’BEK NOMIDAGI

O’ZBEKISTON MILLIY UNIVERSITETI
MATEMATIKA fakulteti

MATEMATIKA yo’nalishi


21-04M GURUHI TALABASI

Komilov Javohirning

DASTURLASH ASOSLARI FANIDAN
MUSTAQIL ISHI

Topshirdi: Komilov Javohir

Qabul qildi: Muxlisa Olimova

Toshkent – 2021

1. 5 ta son berilgan. Nechtasi musbat va nechtasi manfiyligini aniqlovchi dastur tuzing.

#include

using namespace std;

int main()

{

int a,b,c,d,e,mus=0,man=0;



cin>>a>>b>>c>>d>>e;

if (a>0) {

mus++;

}

if (b>0) {



mus++;

}

if (c>0) {



mus++;

}

if (d>0) {



mus++;

}

if (e>0) {



mus++;

}

if (a<0){



man++;

}

if (b<0){



man++;

}

if (c<0){



man++;

}

if (d<0){



man++;

}

if (e<0){



man++;

}

cout<<"musbat: "<

return 0;

}

2. x>0,3 da y =sin2x-cos2x



X<=0,3 da y= 1/(x2-x1/2)

#include

#include

using namespace std;

int main()

{

float x,y;



cin>>x;

if (x>0,3) {

y=pow(sin(2*x),2)-pow(cos(x),2);

}

else {



y=1/(pow(x,2)-sqrt(x));

}

cout<

return 0;

}

3. (sin1/cos1)*((sin1+sin2)/(cos1+cos2))*……… *((sin1+sin2+….+sinn)/(cos1+cos2+….+cosn))



#include

#include

using namespace std;

int main()

{

int n;


float s1=0,p1=1,s2=0,p2=1;

cin>>n;


for (int i=1; is1=s1+sin(i);

p1=p1*s1;

}

for (int i=1; i

s2=s2+cos(i);

p2=p2*s2;

}

cout<


return 0;

}

4. 3ta son berilgan. Ularning o`rtacahsini toping.



#include

using namespace std;

int main()

{

int a,b,c;



cin>>a>>b>>c;

if (a>b) {

if (c>a) {

cout<


}

else if (b>c){

cout<

}

else {



cout<

}

}



else {

if (c>b) {

cout<

}

else if (a>c){



cout<

}

else {



cout<

}

}



return 0;

}

5. 1,1-1,2+1,3+…… ifodaning qiymatini toping.



n ta qo`shiluvchi bor.

#include

using namespace std;

int main()

{

int n;


double s=0.0;

cin>>n;


for (float i=1; is=s+1+i/10;

}

for (float i=2; i

s=s-1-i/10;

}

cout<

return 0;

}

6.



#include

#include

using namespace std;

int main()

{

float x,y,z,f;



cin>>x>>y>>z;

f=pow(y+pow(x-1,1/3),1/4)/(fabs(x-y)*(sin(z)*sin(z)+tan(x)));

cout<

return 0;

}

7. 1+1/2+...1/n>=a a berilgan n ning eng kichik qiymatini toping.



#include

#include

using namespace std;

int main()

{

int k;


float a,s=0,i=1;

cin>>a;


while(ss=s+1/i;


i++;

}

cout<

return 0;

}

8.Uch xonali son berilgan. Bu sonni barcha raqamlari turlichaligiga tekshiring.



#include

using namespace std;

int main()

{

int n;



cin>>n;

if(n/100!=n%10 && n%10!=(n%100)/10 && n/100!=(n%100)/10){

cout<< "barcha raqamlar turlicha";

}

else {



cout<< "barcha raqamlar turlicha emas";

}

return 0;



}
9.Sonni juft-toqligini va musbat-manfiyligini tekshiring.

#include


using namespace std;
int main()

{

int n;



cin>>n;

if (n>0) {

if(n%2==0){

cout<<"musbat juft";

}

else {


cout<<"musbat toq";

}

}



else if (n<0) {

if(n%2==0){

cout<<"manfiy juft";

}

else {



cout<<"manfiy toq";

}

}



else {

cout<<"nolga teng";

}
return 0;

}
10.Kesmada a va b berilgan. Shu ab ni n ta teng bolakka bolingan. Hosil bolgan nuqtalarni toping.

#include
using namespace std;
int main()

{

int n,a,b;



cin>>n>>a>>b;

for(int i=1; i

cout<

}

return 0;



}
11.n+1>0 bolsa y=m*m*n+1-c; n+1<=0 bolsa y=(m+n)*(m+n)+c*m*m; y=?

#include

using namespace std;
int main()

{

int m,n,c,y;



cin>>m>>n>>c;

if(n+1>0){

y=m*m*n+1-c;

}

else {



y=(m+n)*(m+n)+c*m*m;

}

cout<

return 0;

}
12.(1+1/1^2)(1+1/2^2)…(1+1/n^2)=?

#include

using namespace std;


int main()

{

int n;



float p=1;

cin>>n;


for(float i=1; ip=p*(1+1/(i*i));

}

cout<


return 0;

}
13.Agar son Musbat bolsa bittaga oshirilsin, aks holda ozgartirilmasin.

#include

using namespace std;


int main()

{

int n;



cin>>n;

if(n>0){


n=n+1;

}

cout<

return 0;

}
14.4 xonali son berilgan. Sonni polindromlikka tekshiring(agar son teskarisidan ham oqilganda ozgarmasa u palindrom boladi.)

#include

using namespace std;


int main()

{

int n;



cin>>n;

if(n/1000==n%10 && (n%100)/10==(n%1000)/100){

cout<<"polindrom";

}

else{



cout<<"polindrom emas";

}
return 0;

}
15.Agar k1*k2<1 bolsa y=sqrt(2*k1-7*k2); aks holda y=sqrt(2*k1+7*k2); y=?

#include

#include

using namespace std;


int main()

{

float k1,k2,y;



cin>>k1>>k2;

if (k1*k2<1) {

y=sqrt(2*k1-7*k2);

}

else {



y=sqrt(2*k1+7*k2);

}

cout<
return 0;

}
16.1+1/(2^3)+1/(3^3)+…+1/(n^3)=?

#include
using namespace std;
int main()

{

int n;



float y=0;

cin>>n;


for(float i=1; iy=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;



}

Download 17,83 Kb.

Do'stlaringiz bilan baham:




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

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish