
C# Lesson 12
Lesson 12 in a our series about learning C# teaches you about working with methods.

Author
Lesson 11 in our series about learning C# teaches you about working with using boolean operators to control logic flow.
Learn how to use Boolean operators instead of nested If statements.
Afterwards you can continue to the next lesson!
Or go back and review the previous lesson.
We also have the source code on GitHub.
using System;
namespace Lesson11
{
class BooleanOperators
{
static void Main(string[] args)
{
// && - AND
// || - OR
// ! - NOT
Console.WriteLine("Enter 3 numbers:");
Console.Write("1: ");
int number1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("2: ");
int number2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.Write("3: ");
int number3 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine();
Console.WriteLine($"{number1}-{number2}-{number3}");
if (number1 == 0 || number1 > number2 && number1 > number3)
{
Console.WriteLine(number1);
}
else if (number2 > number1 && number2 > number3 || number2 == 0)
{
Console.WriteLine(number2);
}
else if (number3 > number1 && number3 > number2 || number3 == 0)
{
Console.WriteLine(number3);
}
}
}
}
/*
* TASK2:
* Make a program asks the user to enter a SAT and ACT test scores.
* Then ask for the person's Net worth.
*
* If the SAT score is above 1800 and the ACT score is above 25 they
* will get accepted into the school.
*
* But, if their Net worth is > $1,000,000 they will be accepted into
* the school regardless of their scores.
*
*
* Example Output:
*
* Enter SAT score: 1801
* Enter ACT score: 26
* Enter Net worth: 5.00
*
* YOU ARE ACCEPTED!!
*
* Example Output:
*
* Enter SAT score: 170
* Enter ACT score: 20
* Enter Net worth: 5000000.00
*
* YOU ARE ACCEPTED!!
*
* Example Output:
*
* Enter SAT score: 170
* Enter ACT score: 20
* Enter Net worth: 5.00
*
* You are not accepted...
*
*
*/
using System;
namespace Lesson11Task
{
class BooleanOperatorsTask
{
static void Main(string[] args)
{
}
}
}
We have similar articles. Keep reading!
Lesson 12 in a our series about learning C# teaches you about working with methods.
Author
Lesson 10 in a our series about learning C# teaches you about working with arrays.
Author
You're familiar with "while" loops in C#, but but it's time to learn about "for" loops. Let's get loopy in the 7th lesson in our series about learning C#.
Author
$9.99/mo
Unlock every tool, template, and asset with one subscription. Whether you're building a world, writing a story, or running a campaign, go further with expanded storage, AI features, and monthly content drops. No ads, no limits—just pure creative focus. You've started something great—upgrade to bring your vision fully to life.