107 311
Assignments Done
98.9%
Successfully Done
In March 2023

# Answer to Question #256574 in C# for shaves

Question #256574

Write a Program in C# which take two dimension jagged integer array from user, after that display number in the form of Odd and Even from whole array?

1
2021-10-25T14:49:45-0400
using System;
using System.Collections.Generic;

namespace App
{

class Program
{

static void Main(string[] args)
{

int [][]numbers=new int[4][];

for(int i=0;i<4;i++){
numbers[i] = new int[4];
for(int j=0;j<4;j++){
Console.Write("Enter number [{0}][{1}]: ",i,j);
}
}

Console.WriteLine("All even numbers: ");
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
if (numbers[i][j] % 2 == 0) {
Console.Write("{0} ", numbers[i][j]);
}
}
}

Console.WriteLine();
Console.WriteLine("All odd numbers: ");
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
if (numbers[i][j] % 2 != 0)
{
Console.Write("{0} ", numbers[i][j]);
}
}
}

}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!