needed to get 100 pairs of number find all the biggest numbers output is the lowest number
output is the lowest number out of every pair biggest number
4 Replies
using System;
namespace ConsoleApp6
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter the first digit");
int a = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the second digit");
int b = int.Parse(Console.ReadLine());
int max = a > b ? a : b;
for (int i = 0; i < 100; i++)
{
Console.WriteLine("Enter the first digit");
int first = int.Parse(Console.ReadLine());
Console.WriteLine("Enter the second digit");
int sec = int.Parse(Console.ReadLine());
Console.WriteLine("GRATE, NOW NEXT PAIR");
int currentMax = first > sec ? first : sec;
if (currentMax > max)
{
max = currentMax;
}
}
Console.WriteLine($"The minimum value out of all the maximum values is: {max}");
}
}
}
that is code
work or nah
and the
int max = a>b ? a:b
what os the ? between means and the a:b
it's like
and code work?
idk
did you tried ?