Relative Content

Tag Archive for cmultidimensional-array

Value is getting assigned to the wrong row on a multi-dimensional array

// Print an nxn magic square #include <stdio.h> int main(void) { int n; printf(“This program creates a magic square of a specified size.n”); printf(“The size must be an odd number between 1 and 99.n”); printf(“Enter size of the square: “); scanf(“%d”, &n); int square[n] [n]; for (int i = 0; i < n; i++) { […]

Filling a C# array

I need to fill a 2 dimensional array, however in need to the 2 outermost sides to be filled with ones and the rest with zeros.

sum of arrays usiing 2d arrays in c programming

I have been trying to solve and sum the each row in the problem for like trying to from last two days with no luck . kinda new to programming and please help me out with this….the real problem im facing is when im trying to sum after initializing the the array of 20 students with 5 subjects ,in the first case i got sum of garbage value many times now im ended up with garbage of a code below.

pass an array inside a multidimensional array to a function in C#

I’m trying to take a 3D array and pass an array inside there to a function, but it keeps saying an error about having the wrong number of indices inside []. I’m passing 2 values to it to return an array for a function but it’s requiring me to put 3 values for a single item not an array.