English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How I Can write code in C++ that will declare, initialize, and fill in an array of objects of type int. After your code executes, the array should look as follows.

0 2 4 6 8 1012141618

2007-02-03 17:48:31 · 5 answers · asked by Ahsan Z 1 in Computers & Internet Programming & Design

5 answers

int myArray[10];

for (int x = 0; x< 10; x++) {
myArray[x] = 2*x;
}

2007-02-03 17:55:16 · answer #1 · answered by Alan 6 · 0 0

int iArray[] = new int[]{0,2 ,4, 6 ,8 ,10,12,14,16,18}
int i = 0;
for (i = 0; i < 10; i++)
cout<

2007-02-03 17:53:36 · answer #2 · answered by IAnswer 2 · 0 0

Im also studying the C language!Good luck to us!

2007-02-03 17:58:24 · answer #3 · answered by migumi 1 · 0 0

include int major(void){ int ok,j; int a[10][10]; for(ok=0;ok<10;ok++) for(j=0;j<10;j++) a[j][ok]=ok*10+j; for(ok=0;ok<10;ok++) for(j=0;j<10;j++) printf("%d ",a[j][ok]); go back 0; }

2016-11-02 06:47:20 · answer #4 · answered by dewulf 4 · 0 0

check out http://www.pscode.com for great sample codes.

2007-02-03 18:05:09 · answer #5 · answered by Richard H 7 · 0 0

fedest.com, questions and answers