Question 4

AQA Computer Science Specimen Paper 1A (8525/1A)GCSE5 marks

On the specification

3.2 Programming
Question text

4 A programmer has written a C# program that asks the user to input two integers and then output which of the two integers is the largest. Complete the program by filling in the gaps using the information in Figure 3. Each item in Figure 3 should only be used once. [5 marks] Figure 3 Console.Write num1 num2 output else < > else if string double int int num1; num2; Console.WriteLine("Enter a number: "); num1 = int.Parse(Console.ReadLine()); Console.WriteLine("Enter another number: "); num2 = int.Parse(Console.ReadLine()); if (num1 > num2) { Console.WriteLine(" is bigger."); } else if (num1 num2) { Console.WriteLine(" is bigger."); } { Console.WriteLine("The numbers are equal."); }