Output and Debugging Questions (10 marks each) [20 Marks]
Note: Provide a copy of the code and screen shot for the output inthe solutions’
1. Trace the following program and write the exact output for thefollowing inputs.
Explain each output. [10 Marks]
a. Input of an array { 20, 80 , 63, 89 }
b. Input of an array { 1, 2 ,3, 4}
c. Input of an array { 100, 200 ,300, 400}
d. Input of an array { -8, -9, -10, -11} ( Negative numbers)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
int[] M = new int[4] ;
for (int i = 0; i <4; i++)
{
M[i] = Int32.Parse(Console.ReadLine());
}
for (int i = 0; i < M.Length; i++)
{
M[i] = M[i] + 10;
Console.Write((M[i] / 3) + \" \");
}
Console.ReadKey();
}
}
}