Need your Help .. C++

Hi ..

good day every one ..!!
Could you please discuss this example with me ??

A 4-by-4 array of integers. Write a C++ program to accomplish each of the following operations:

a. Declare the above array.
b. Read the array.
c. Find and print the sum of odd elements in the main diagonal of the array.
d. Replace each zero in the array by 1.



I need your help to understand this example ...

thanks ..
Last edited on
So, what part are you having trouble with? PS: This should go to the beginner section.
a - How can I declare the array ?

int X[4][4];

??
Yes? Were you asking if that's correct? You can declare a 4x4 array like that.
If it is correct, what is meant by read the array ?
I don't know, but I suppose the intended meaning is "Read values from the console and put them into the array".
So, how could I do that ?

Could you help me, please to do it ... <3
You have an array. In this array there are 4 arrays. In each of those 4 arrays, there are 4 int elements. I assume you know how to read in a single value? And just try to think hard - what do you do when you want to do the same thing with slight modifications many times in a row?
Great explanation ... more help to do it please :$

Need your help ... plz
Topic archived. No new replies allowed.