Topshiriq -1
Download 157.8 Kb.
|
Dasturlash-3
Muhammad al-Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti dasturiy injiniring fakulteti 316-22- guruh talabasi Rashidov Azamatning dasturlash I fanidan yozgan amaliyot ishi-3 VARIANT-10; Topshiriq -1 :
Dastur kodi: #include using namespace std; int main(){ int j=8; double s=0; int a[j]={1,17,2,4,-5,0,7,8}; cout<<"Massiv elementlari :"; for(int i=0;i cout<<"\nMassivda nolga teng elementgacha bo'lgan elementlar yig'idisi :"; for(int i=0;i s+=a[i]; } else break; }cout< Dastur natijasi : Topshiriq -2: Dastur kodi: #include #include using namespace std; void arifmetik_geometrik(double a,double b){ double s,p; s=(a+b)/2; p=sqrt(a*b); cout< cout<<"O'rta arifmetrigi :"< } int main(){ double a,b,c,d; cout<<"a=";cin>>a; cout<<"b=";cin>>b; cout<<"c=";cin>>c; cout<<"d=";cin>>d; arifmetik_geometrik(a,b); arifmetik_geometrik(a,c); arifmetik_geometrik(a,d); return 0;} Dastur natijasi : Topshiriq -3: Dastur kodi: #include #include #include using namespace std; int main(){ srand(time(0)); int m; int n; cout<<"M=";cin>>m; cout<<"N=";cin>>n; int a[m][n]; cout<<"\n["< cout<} cout< cout<<"\nMatritsani juft satrdagi elementlari :\n"; for(int i=0;i cout< return 0;} Dastur natijasi : Download 157.8 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling