Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(Find the smallest value) I need to write an application that finds the smallest

ID: 3656015 • Letter: #

Question

(Find the smallest value) I need to write an application that finds the smallest of several integers . Assume that the first value read specifies the number of values to input from user. My instructor wants us to use the for statement. see below. using System; public class ForCounter { public static void Main(string[] args) { // for statement header includes initialization // loop-continuation condotion and increment for (int counter = 1; counter <= 3; counter++) // declare variable, specify the ending point @ 10 Console.Write("{0} ", counter); Console.WriteLine(); // output a newline Console.ReadLine(); } // end Main } // end class ForCounter

Explanation / Answer

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class FindSmallestValue { static void Main(string[] args) { int numbers, input,smallest=0; Console.Write("Enter the number of numbers: "); numbers = int.Parse(Console.ReadLine()); for (int i = 0; i