0

using a for Loop initialise the contents of a 10 element array of the type int to 0. using another for loop print the contents of the array to the screen.

how can i rezolve this question

7th Jul 2016, 3:33 PM
Adrian Lupu
Adrian Lupu - avatar
3 Answers
0
int myArray[10]; for(int i = 10; i != 0; myArray[--i] = 0); for(int i = 0; i != 10; cout << myArray[i++]);
7th Jul 2016, 10:13 PM
Tony Christopher
Tony Christopher - avatar
0
or: int myArray[10]; int i = 10; for(; i != 0; myArray[--i] = 0); for(; i != 10; cout << myArray[i++]);
7th Jul 2016, 10:26 PM
Tony Christopher
Tony Christopher - avatar
0
string[] strArr= new string[10]; for(int i = 0; i < 10; i++) strArr[i] = Console.ReadLine(); for(int i = 0; i < 10; i++) Console.WriteLine(strArr[i]); Hope that helps 😀😁
8th Jul 2016, 7:53 PM
Erwin Mesias
Erwin Mesias - avatar