Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

E

1.

. ,

, .

4 6 7 8 9 2 3 1 12 7

0 1 2 3 4 5 6 7 8 9

7 , 2 .

10 , 0 9.

2. :

tip ime_niza[];

: int a[10];

* a

.
:

int a[i]; int a[n]; ..

* ,
a[1]

int a[n] N

: a) n

int n;

cin>>n;

int a[n];

) n

Int n;

n=25;

int a[n];

, 6,

.
: .

3. :

tip ime_niza[]={br1,br2,br3};

int a[]={1,2,3,4,5,6,7,8,9};

* 1, 2, 3, 4,
5, 6,

7, 8 9.

10
0

10 ).

for(i=0;i<10;i++)

cin>>a[i];

.
.

for(i=0;i<10;i++)

cout<<a[i];

10

. .

, ,

, .

,
.

C++

#include<iostream> //

using namespace std;

int main(){ //

int a[10],i,s=0; //

cout<<"\n Vnesete gi elementite na nizata "<<endl;//

for(i=0;i<10;i++) { //

cout<<"\n a["<<i<<"]="; //

cin>>a[i]; //

} //

cout<<"\n Vnesenata niza e : " ; //

for(i=0;i<10;i++) //

cout<<" "<<a[i]; //

for(i=0;i<10;i++) //

if(a[i]%2==0) //

s=s+a[i]; //

cout<<"\n Sumata od parnite vrednosti e :"<<s<<endl;//

return 0;} //

You might also like