Chiziqli jarayonlarga oid masalalar


Download 0.71 Mb.
Sana05.01.2022
Hajmi0.71 Mb.
#225025
Bog'liq
Dasturlash 1


Chiziqli jarayonlarga oid masalalar

//1-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

float a,b,c,S,P,p;



int x1,y1,x2,y2,x3,y3; cout<<"kordinatalarnikiriting"<Norkulov Daler

#include

#include

using namespace std;

int main()

{

float r,R;



cout<<"kichik radiusni kiriting"<>x; cout<<"Betta burchak kiriting: ";cin>>y; cout<<"c=";cin>>c; a=c*sin(x*M_PI/180); b=c*sin(y*M_PI/180); cout<<"a="<

return 0;



}

//4-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

int a,b,c,p,s;



cout<<"Tomonlarni kiriting"<Norkulov Daler

#include

#include

using namespace std;

int main()

{

float r,s,l;



cout<<"Radiusni kiriting"<

return 0;



}

//7-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

float a,b,h;



cout<<"Katetlarni kiriting"<

}

//9-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

float a,b,c,meda,medb,medc; cout<<"Tomonlarnikiritng"<

return 0;



}

//10-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

float h,r,v;



cout<<"Balandlik va radiusni kiriting"<

}

//12-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

floata,r;



cout<<"Vatar va radiusnikiriting"<

(a/(2*r))*(a/(2*r)))))<<" marta katta"; return 0;



}

//13-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

float s,r,n,S;



cout<<"Kvadratning yuzini kiriting "<>s;

r=(sqrt(s)*0.5); S=r*r;



n=s/S;

cout<<"Kvadratga ichki chizilgan aylanaga ichki chizilgan kvadratning yuzi "<

cout<<"Berilgan kvadratning yuzidan ichki chizilgan kvadratning yuzi: "<

return 0;



else cout<<"Musbat raqam kiriting!"; return 0;

}

}



Tarmoqlanuvchi jarayonlar
//14-masala. Mualllif:.. Norkulov Daler

#include

using namespace std;

int main()

{

int a,b,c;



cout<<"Sonlarni kiriting"<0 && b>0 && c<=0) cout<<"2 tasi musbat"; if(a>0 && b<=0 && c>0) cout<<"2 tasi musbat"; if(a<=0 && b>0 && c>0) cout<<"2 tasi musbat"; if(a<0 && b<0 && c<0)

cout<<"birortasi ham musbat emas"; if(a>0 && b<=0 && c<=0) cout<<"bittasi musbat";

if(a<=0 && b<=0 && c>0) cout<<"bittasi musbat"; if(a<=0 && b>0 && c<=0) cout<<"bittasi musbat"; return 0;



}


//15-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

float o,m,b,n;



cout<<"Qiymatlarni kiriting"<

cout<<"olmaga ko'proq pul sarflangan"; if((o*m)==(b*n))

cout<<"ikkalasigi ham teng pul sarflangan";

}
//16-masala. Mualllif: Norkulov Daler

#include

using namespace std;



intmain()

{

inta,b;



cout<<"Qiymatlarni kiriting"<

else


cout<<"b/2="<}

else



cout<<"Xatto raqam!!"; return 0;

}

//17-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

float v1,v2,m1,m2,p1,p2;



cout<<"Hajm va og'irliklarni kiriting"<

if(p1

cout<<"ikkinchi jismning zichligi katta"; else



if(p1==p2)

cout<<"ikkala jismning ham zichligi bir xil"; return 0;



}

//18-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,a,s,a1,a2;



cout<<"ikki xonali son kiriting: "; cin>>n;

cout<<"a="; cin>>a;



a1=n/10; a2=n%10;

s=a1+a2; if(3%s==0)

{cout<

{cout<

{cout<<"raqamlar yig'indisi "<

{cout<<"raqamlar yig'indisi "<

}

//19-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,n1,n2,n3,n4,s,p; cout<<"n="; cin>>n; n1=n/1000; n2=(n/100)%10; n3=(n/10)%10; n4=n%10;



s=n1+n2+n3+n4; p=n1*n2*n3*n4; if(n1+n2==n3+n4)

cout<<"1- va 2- raqamining yig'indisi,oxirgi ikki raqamining yig'indisiga teng"<

else

cout<<"1- va 2- raqamining yig'indisi,oxirgi ikki raqamining yig'indisiga teng emas"<

if(3%s==0)

cout<<"raqamlar yig‘indisi 3 ga karrali"<

cout<<"raqamlar yig'indisi 3 ga karrali emas"<

cout<<"raqamlar ko‘paytmasi 4 karrali"; else



cout<<"raqamlar ko'paytmasi 4 karrali emas"; return 0;

}

//20-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

else



cout<<"bunday uchburchak mavjud emas!!"; return 0;

}

//21-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int a,b,c,k=0; cout<<"a=";cin>>a; cout<<"b=";cin>>b; cout<<"c=";cin>>c; if(a<0)k++; if(b<0)k++; if(c<0)k++;



cout<<"manfiylar soni "<
}

//22-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

float a,b,c;



cout<<"tomonlarni kiriting"<

}

else


cout<<"to'g'ri burchakli uchburchak emas";

}

else



cout<<"bunday uchburchak mavjud emas!!"; return 0;

}

float a,b;

cout<<"a burchakni kiriting: ";cin>>a; cout<<"b burchakni kiriting: ";cin>>b; if((a+b)<180)

{

if((a==90 && b<90) || (b==90 && a<90) || ((a+b)==90)) cout<<"uch burchak to'g'ri burchakli";



else

cout<<"uch burchak to'g'ri burchakli emas";

}


//23-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;


int main()

{

float a,b,c;



cout << "Nuqtalarni kiriting" <else if(fabs(a-b)

bo'lgan masofa teng";

if(b==c&&c==d&&a!=b) cout<<"uchta raqami bir xil"; else if(a==c&&c==d&&b!=c) cout<<"uchta raqami bir xil"; else if(a==b&&b==d&&c!=d) cout<<"uchta raqami bir xil"; else if(a==b&&b==c&&d!=a) cout<<"uchta raqami bir xil";

else cout<<"uchta raqami bir xil emas";

}

else



cout<<"xatto son!!"; return 0;

}

return 0;



}


//24-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

float a,b,c,n;



cout<<"Sportchilarni natijasinikiriting"<>a;

cout<<"2-sportchining natijalarini kiriting:"; cin>>b;

cout<<"3-sportchining natijalarini kiriting:"; cin>>c;

if(a

cout<<"3-sportchi g'olib"; else if(c

else if(c==a&&a==b&&c==b) cout<<"durrang!";



return 0;

}

//25-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,a,b,c,d; cout<<"n="; cin>>n; a=n/1000; b=(n/100)%10; c=(n/10)%10; d=n%10;



if(n>999&&n<10000)

{

//26-masala. Mualllif: Norkulov Daler



#include

using namespace std;

int main()

{

float a,b,c;



cout<<"Qiymatlarni kiriting"<

return 0;

}

//27-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

char n;



cout<<" k ni kiriting(faqat belgilar)"<

case ',':cout<<"Bu vergul";break;

case '!':cout<<"Bu undov";break;

case '?':cout<<"Bu so'roq";break;

case ';':cout<<"Bu nuqtali vergul";break;

case '...':cout<<"Bu ko'p nuqta";break;


case '-':cout<<"Bu tire";break;

case '()':cout<<"Bu qavs";break;

case '""':cout<<"Bu qo'shtirnoq";break; default:cout<<"bunday belgi ro'yxatimizda yo'q!!";

}

return 0;



}

else if(a==c&&c==d&&b!=c) cout<<"uchta raqami bir xil"; else if(a==b&&b==d&&c!=d) cout<<"uchta raqami bir xil"; else if(a==b&&b==c&&d!=a) cout<<"uchta raqami bir xil";

else cout<<"uchta raqami bir xil emas";

}

else


cout<<"xato son!"; return 0;

}




//28-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n;



cout<<"n ni kiriting"<

default:cout<<"(0-9) oralig'idagi musbat butun sonlarni kiriting!";

}

return 0;



}

//30-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int y,o,y1,o1,ny,no; cout<<"Ma'lumotlarni kiriting"<>y; cout<<"tug'ilgan oy: ";cin>>o; cout<<"hozirgi yil: ";cin>>y1; cout<<"hozirgi oy: ";cin>>o1; if((y>0&&o>0)&&(y1>0&&o1))



{

ny=y1-y; no=o-o1; if(no<=0)

cout<<"yoshingiz "<

cout<<"yoshingiz "<

}

else


cout<<"Xato son!"; return 0;

}





//29-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,a,b,c,d;



cout<<"n in kiriting(999

//31-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,n1,n2,a,b;



cout<<"n ni kiriting"<


cout<<"javob o’rinli"; else

cout<<"javob o’rinsiz";



}

else


cout<<"xato son!"; return 0;

}

//32-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=100,a,b,c; while(i<=999)



{

a=i/100; b=(i/10)%10; c=i%10;

if(a==c) cout<

}

return 0;



}

//33-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,e,b,c,s,p,a;



cout<<"n va a nikiriting"<9&&s<100))

cout<

if (p>99&&p<1000)

cout<99&&p<1000))

cout<p)

cout<

else if(!(a>p))

cout<

return 0;



}

//34-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,n1,n2,n3;



cout<<"n ni kiriting"<

cout<<"2 ta raqam bir xil"; if(n1==n3 && n1!=n2) cout<<"2 ta raqam bir xil"; if(n2==n3 && n1!=n2) cout<<"2 ta raqam bir xil";

if(n1!=n2 && n2!=n3 && n3!=n1) cout<<"birorta raqam bir xil emas";

}

else



cout<<"xato son!"; return 0;

}

//35-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,e,b,c,d,s,p,a;



cout<<"n va a ni kiriting"<
cout<

else if(!(e+b==c+d))

cout<

if (3%s==0)

cout<

cout<

cout<

cout<

if(p%a==0)

cout<

else if(!(p%a==0))

cout<

return 0;

cout<<"A nuqta kordinatalarini kiriting"<

if(a==b)

cout<<"A nuqta ham B nuqta ham koordinata boshiga nisbattan bir xil uzoqlikda joylashgan ";

if(a

cout<<"B nuqta koordinata boshiga nisbatan yaqinroq joylashgan";



return 0;

}

}


//36-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

float a,b,c;



cout<<"sonlarni kiriting"<>a;

cout<<"uchburchakning b burchagini kiriting: "; cin>>b;

c=180 - (a+b);

if(a+b<180 && a>0 && b>0)

{

if(a==90 || b==90 || c==90)



cout<<"uchburchak to'g'ri burchakli uchburchak"; else

cout<<"uchburchak to'g'ri burchakli uchburchak emas";



}

else


cout<<"bunday uchburchak mavjud emas!"; return 0;

}

}


//37-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

float x1,y1,x2,y2,a,b;



//39-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

float a,b,x,y;



cout<<"x va y ni kiriting"<
b=(x+y)/2; if(x>y)

{

x=a; y=b;



cout<<"x="<

}

//42-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int s=0,x=10;



cout<<"10<=x<=20 bo'lsa f(x)=x^2+x qiymatlari "<

{

s=s+x*x+x;



cout<<"f("<x++;

}

//40-masala. Mualllif: Norkulov Daler

#include

using namespace std;
int main()

{

float x,y;



cout <<" a nuqta kordinatalarini kiriting" << endl; cout<<"x=";cin>>x;

cout<<"y=";cin>>y;

if(x==0&&y==0)cout<<"a nuqta kordinata boshida joylashgan"; else if(x==0&&y!=0)cout<<"a nuqta y o'qida joylashgan";

else if(x!=0&&y==0)cout<<"a nuqta x o'qida joylashgan"; else if(x>0&&y>0) cout<<"a nuqta birinchi chorakda

joylashgan";

else if(x<0&&y>0) cout<<"a nuqta ikkinchi chorakda joylashgan";

else if(x<0&&y<0) cout<<"a nuqta uchinchi chorakda joylashgan";

else if(x>0&&y<0) cout<<"a nuqta to'rtinchi chorakda joylashgan";



return 0;

}

//41-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int s=0,i;



cout<<"yig'indi101+103+105+. +301 =";

for(i=101;i<=301;i=i+2)



{

s=s+i;


return 0;

}

//43-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=1,j=0; while(i<99)



{

i=i+2; j++;



}

cout<<"[1;100] oralig‘idagi toq sonlar n="<
return 0;

}

//44-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=12,n=0; while(i>10 && i<99)



{

i=i+3; n++;

}

cout<<"n="<
return0;

}




//45-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

cout<<"10 dan 50 gacha bo'lgan butun sonlar kvadratlarining yig'indisi "<

int i=10,s=0; while(i>9 && i<50)

{ i++;


s=s+i*i;

}

cout<<"s="<

}


//48-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=12,j=0; while(i>10 && i<99)



{

i=i+3; j++;



}

cout<<" "<

return0;


}



//46-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

cout<<"10 dan 40 gacha bo'lgan butun sonlar kvadratlari: "<

while(i>=9 && i<40)

{ i++;


s=i*i;

cout<<" "<

}

return 0;



}

//47-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

int i,s;


cout<<"1 dan 50 gacha sonlarning kvadrat \n ildizi qiymatlari"<

for(i=1;i<=50;i++)

{

cout<<" "<

}

return 0;

//49-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=15,j=0;



cout<<"20 dan 500 gacha 5 ga bo'linadigan sonlar"<10 && i<500)

{

i=i+5; j++;



}

cout<<"n="<
return 0;

}

//50-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=12,j=0;



cout<<"3 ga qoldiqsiz bo'linadigan ikki xonali sonlar"<10 && i<99)

{

i=i+3; j++;



}

cout<<"n="<

}


}

//51-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()



{
int main()

{



int s=0,n;

cout<<"n ni kiriting"<

{

cout<<"n="; cin>>n; if (n > 0) {s += n;}



}

cout<<"s="<

}


//54-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

int n,m,p,EKUK;



cout<<"2 ta sonni EKUK ini aniqlash"<
n%=m; swap(n,m);

}


//52-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int s=0,n;



cout<<"n ni kiriting"<

}

//53-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

int a,b,EKUB;



cout<<"2 ta o'zaro tub sonlarni aniqlash"<

}

else cout<<"n>0 bo'lishi kerak"; return 0;



}

}

if(a!=1)


{



EKUB=a; cout<<"EKUB="<}

else cout<<"a va b soni o'zaro tub sonlar"; return 0;



}
//56-masala. Mualllif: Norkulov Daler

#include

using namespace std; int main()

{
int n,c,a=0,k=1;




cout << "Natural son kiriting. Agar haqiqiy butun musbat son kiritilsa \n butun qismi bilan amallar bajariladi" << endl;

cout<<"c="; cin>>c;

if(c>0)

{

{




cout<<"c="; cin>>c; if(c>0)

n=c;

while(n!=0)

{

if(n%10==7){a=a+(1+(n%10))*k; k=k*10;}


if(n%10!=1&&n%10!=7&&n%10!=0){a=a+(n%10)*k;k=k*10;} if(n%10==0){a=a+n%10;k=k*10;}

n=n/10;

}cout<

}

else cout<<"natural son kiritilmadi!"; return 0;



}

//59-masala. Mualllif: Norkulov Daler

#include

using namespace std;


int main()

{

int a=0,s=0,b,i=2,n,j;



cout<<"n natural son bo'lishi kerak,\n haqiqiy musbat son kiritilsa uning butun qismi olinadi"<

cout << "n="; cin>>n;

if(n>=2)

{

while(i<=n)



{

j=1;


//57-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int a=1,b=1,c,n;



cout<<"Fibonachi sonlari chiqariladi"<

if(i%8==0)cout<

}

}



return 0;

}

//58-masala. Mualllif: Norkulov Daler

#include

using namespace std; int main()

{

int n,a=1,b=1,c,k=1; cout<<"n ni kiriting"<

}

return 0;



while(j<=i)

{

if(i%j==0)



{

s=s+j;


} j++;

}

if(a

i++;

}

cout<<"x="<

kstta son

}

else cout<<"n=>2 natural son bo'lishi kerak";


return 0;

}

//60-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int s=0,n,i=1;



cout<<"n ni kiriting"<
}

//61-masala. Mualllif: Norkulov Daler

#include

using namespace std; int main()

{
float y,i=1;

cout << "juftlik "; while(i<=100)

{

y=i/(i-1); if(y==i)cout<

}

return 0;



}




//64-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n=2,i=1,a;



cout<<"a ni kiriting"<


}

//62-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,s=0,a;



cout<<"n ni kiriting"<>n; k=n;

while(n!=0)

{

n=n/10; i=i*10;



}

cout<<" teskari ketma-ketlik"<

while(k!=0)

{

//63-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

a=k%10;


s=s+a*i;

k=k/10;


i=i/10;

}

cout<

return 0;

}


int i=2,k=1;

long long int s=0,p=1;

cout<<"a.progressiya2,3,5,8, "<

do

{



s+=i; p=p*i; i=i+3; k++;

}

while(k<=10);



cout<<"a. progressiyaning dastlabki 10 ta hadining ko'paymasi:p="<

cout<<"a. progressiyaning dastlabki 10 ta hadining yig'indisi:s="<

return 0;

}

//66-masala. Mualllif: Norkulov Daler



#include

using namespace std; int main()

{

int n,s=0,a,i=1;



cout << "n=" ; cin>>n;

cout<0)

{

while(i<=n)



{

int j=1;

while(j

{

if(i%j==0)



{




s=s+j;

} j++;


}

if(s==i)


{

cout<

} s=0; i++;

}

}



else cout<<"n natural son bo'lishi kerak!";
return 0;

}

//69-masala. Mualllif: Norkulov Daler #include

#include using namespace std; int main()

{

float a,p; int n;



cout<<"sonlarni kiriting"<


//67-masala. Mualllif: Norkulov Daler

#include

using namespace std;



int main()


int i=100,a,b,c; for(i=101;i<=999;i++)

{

a=i/100;



b=(i/10)%10;

c=i%10;


if(a!=b&&b!=c&&a!=c)

cout<

}

return 0;



}

//70-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=10,a=0,n;



cout << "element qiymatini kiriting " << endl;

cout<<"n="; cin>>n;

while(i<=n)

{

i=i+10;



a++;

}cout<

return 0;


}

//67-masala. Mualllif: Norkulov Daler

#include

#include

using namespace std;

int main()

{

int n; float s=0;



cout<<"n ni kiriting"<

cout<<"n="; cin>>n;

for(int i=0;i <=n;i++)

{

s+=pow ((-1),i)*pow (2,(-i));



}

cout<<"s="<

return 0;

}


//71-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,i=1,m=1;



cout << " Natija necha satir(n) bo'lsin" << endl;

cout<<" n="; cin>>n;

cout<<" Pifagor sonlari"<

cout <

cout<<" a^2"<<"+"<<"b^2"<<"="<<"c^2"<

cout <

while(i<=n)

{

cout<<" "<<3*m<<"^2"<<"+"<<4*m<<"^2"<<"="<<5*m<<"^2"<


m*=2; i++;

}



return 0;

}

//72-masala. Mualllif: Norkulov Daler

#include

using namespace std;

intmain()

{

intk=0;



for(int i=2;i<99,i<=999;i++)

{

for(int j=2;j*j<=i;j++)



{

if(i%j==0)

{

k=1;break;



}

}

if(k==0) cout<

k=0;

}

return 0;



}

//74-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int a,b,i,s=0,y=1,n;



cout << "a dan b gacha(a

cout<<"a="; cin>>a; cout<<"b="; cin>>b; if(a0)

{

while(a<=b)



{

int j=1; while(j<=a)

{

if(a%j==0)



{

s=s+j;


}

j++;


}

if(y

else s=0;

a++;


}

cout<<"x="<

katta son

}

else cout<<"shartga e'tibor bering";



return 0;

//73-masala. Mualllif: Norkulov Daler

using namespace std;

int main()



}







{

int i=1;


cout << "1 dan 100 gacha tub sonlar" << endl; cout << endl;

while(i<=100)

{

//if(i==2)cout<

while(j<=i)

{

if(i%j==0&&i!=j)



{

break;


}

if(i%j==0&&j==i)cout<<" "<

}

i++;


}

return 0;

}

//75-masala. Mualllif: Norkulov Daler



#include

using namespace std;

int main()

{

int n,i=100,s=0,n1,n2,n3;



cout<<"n="; cin>>n; if(n>0&&n<=27)

{

while(i<=999)



{

n1=i/100;

n2=(i%100)/10;

n3=(i%100)%10;

s=n1+n2+n3;

if(s==n)cout<

s=0;

}

}



else cout<<" 0

return 0;



}





//76-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=100,a,b,c;



for(i=101;i<=999;i++)

{

a=i/100;



b=(i/10)%10;

c=i%10;


if(a!=b&&b!=c&&a!=c) cout<}

return 0;



}

//78-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i,j,k;



cout<<"10 ni kvadratlari yig'indisi 58 ga teng \n bo'lgan ikkita songa ajratish"<

for(i=1,j=9;i<=5,j>=5;i++,j--)

{

if(i*i+j*j==58) cout<

}

return 0;



}

//79-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{


//77-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int i=1,n,m;



cout<<"n dan kichik va m bilan o'zaro tub bo'lgan barcha natural sonlar"<

cout <<"n=";cin>>n;

cout <<"m=";cin>>m;

while(i<=n)

{

int j=2; while(j<=i)



int a,b,c,d;

for(int i=1023;i<=9999;i++)

{

a=i/1000; b=(i/100)%10; c=(i/10)%10; d=i%10;



if(a!=b&&b!=c&&c!=a&&c!=d&&d!=a&&d!=b) cout<

}

return 0;



}

{

if(i%j==0&&m%j==0&&j!=i)

{

break;


}
if(j==i&&i%j==0&&m%j==0)

{

break;



}

if(j==i&&i%j!=0&&m%j==0)cout<

j++;

}

i++;



}

return 0;



}


//80-masala. Mualllif: Norkulov Daler
//81-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,i=0,b,m=1,c,s=0;



cout << "n ni kiriting" << endl;

cout<<"n="; cin>>n;

cout<<"a massivni elemenlari soni(c) qancha bo'lsin? \n Elemenlarni o'zingiz kiritasiz"<

cout<<"c="; cin>>c;

int a[c];

while(i

{

cout<<"a massivni "<>b;



a[i]=b;

if(b>n){s=s+b;}



i++;


}

cout<<"yig'indi="<return 0;



}




//82-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n=6,a[n]={1,2,3,4,5,6},i=0,k,b;



cout<<"a[6]={1,2,3,4,5,6}"<

cout<<"qaysi elementi(k) ko`chirilsin?"<

cin>>k;

cout<<"qolgan elementlar"<

while(i<6)

{

if(i!=k-1)cout<<" "<

i++;

}

return 0;



}

//83-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,i=0,k,b,m=1,c;



cout<<"a massivni elemenlari soni(c) qancha bo'lsin? \n Elemenlarni o'zingiz kiritasiz"<

cout<<"c="; cin>>c;

cout << "o'chirilishi kerak bo'lgan sonni kiriting " << endl; cin>>n;

int a[c];

while(i

{

cout<<"a massivni "<>b;



a[i]=b;

i++;


}

i=0;


while(i{

if(a[i]==n){k=i; b=i;}



i++;

}

return 0;



}

//84-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int a[10]={1,2,3,4,4,4,5,6,7,7},k=0;



cout<<"berilgan massiv a[10]={1,2,3,4,4,4,5,6,7,7}"<

int i=0;


while(i<10)

{

if(a[i]==a[i+1])k++;



i++;

}

cout<<"o`zaro teng qo`shni elementlar juftligi soni "<

return 0;

}

//85(a)-masala. Mualllif: Norkulov Daler

#include

using namespace std;

int main()

{

int n,i=0,c,b;



cout<<" massiv elementlari nechta bo'lsin"<

cout<<" "; cin>>c;

cout << " massiv elementlarini inter orqali kiriting" << endl;

int a[c];

while(i

{

cout<<" "; cin>>b;



a[i]=b;

i++;


}

cout<

i=0;

while(i

{

cout<<" "<

i++;

}

return 0;



}




Download 0.71 Mb.

Do'stlaringiz bilan baham:




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