C#: Check two given numbers where one is less than 100 and other is greater than 200
Check Numbers Less than 100 & Greater than 200
Write a C# program to check two given numbers where one is less than 100 and the other is greater than 200.

Sample Solution:-
C# Sharp Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class Exercise35 {
static void Main(string[] args) {
// Prompt the user to input the first number less than 100
Console.Write("Input a first number(<100): ");
// Read user input and convert it to an integer 'm'
int m = Convert.ToInt32(Console.ReadLine());
// Prompt the user to input the second number greater than 200
Console.Write("Input a second number(>200): ");
// Read user input and convert it to an integer 'n'
int n = Convert.ToInt32(Console.ReadLine());
// Check if the first number is less than 100 AND the second number is greater than 200
// Print the result of the logical AND operation between the conditions
Console.WriteLine((m < 100 && n > 200));
}
}
Sample Output:
Input a first number(<100): 75 Input a second number(>100): 250 True
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C# program to validate if one number is under 50 and the other over 500.
- Write a C# program to swap numbers if the first is greater than 200 and second less than 100.
- Write a C# program to check whether any of three numbers satisfy: one less than 100 and one more than 200.
- Write a C# program to determine if a given pair of numbers violates a min-max constraint (e.g., x < 100 and y > 200).
Go to:
PREV : Check String Starts with Word.
NEXT : Check Integer in Range -10 to 10.
C# Sharp Code Editor:
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.