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 - AQA - GCSE Computer Science - Question 4 - 2021 - Paper 1
Question 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 fill... show full transcript
Worked Solution & Example Answer: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 - AQA - GCSE Computer Science - Question 4 - 2021 - Paper 1
Step 1
Fill in the gaps with the correct types and logic
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Console.Write(string num1);
int num2;
if (num1 > num2)
{
Console.WriteLine("num1 is bigger.");
}
else if (num1 < num2)
{
Console.WriteLine("num2 is bigger.");
}
else
{
Console.WriteLine("The numbers are equal.");
}