shar ch[4]={’a’,’b’,’c’,’d’}; //belgilar massivi




Download 33,55 Kb.
bet4/4
Sana17.11.2023
Hajmi33,55 Kb.
#100585
1   2   3   4
Bog'liq
4-mustaqil ish (1)

shar ch[4]={’a’,’b’,’c’,’d’}; //belgilar massivi
int in[6] ={10,20,30,40}; // butun sonlar massivi
char str[]=”abcd”;
//satr uzunligi 5 ga teng, chunki uning oxiriga
// ’\0’ belgisi qo‘shiladi
char str[]={’a’,’b’,’c’,’d’};
// yuqoridagi satrning boshqacha yozilishi
Masala. Bir o`lchamli sonli massivni M dan kichik elementlarini kvadratlarini yig`indisi xisoblansin
#include
using namespace std;
int main()
{
int i,n;
cout<<"n: ";
cin>>n; double a[n];
for(i=0; i>a[i];
double s=0,m;
cout<<"M: "; cin>>m;
for(i=0; i{
if(a[i]s+=a[i]*a[i];
}
cout<<"Natija = "<return 0;
}




Download 33,55 Kb.
1   2   3   4




Download 33,55 Kb.

Bosh sahifa
Aloqalar

    Bosh sahifa



shar ch[4]={’a’,’b’,’c’,’d’}; //belgilar massivi

Download 33,55 Kb.