+ 1
Why is it not showing any output?
3 Answers
+ 10
MrDevEzeoke , you are returning some data from the function, but it is not used, and there is also missing an output statement.
it could be done like this:
...
int[] result = ArrayOfMult(number,length);
foreach (var item in result)
{
Console.WriteLine(item);
}
...
+ 4
Because it only returns array. You should print each element of returned array (preferably in Main).
Try to use this:
foreach(var item in ArrayOfMult(number, length)) {
Console.WriteLine(item.ToString());
}
instead of:
ArrayOfMult(number,length);
(other variants: https://stackoverflow.com/questions/16265247/printing-all-contents-of-array-in-c-sharp )