“Verschachtelt, wenn ... sonst Aussage” Code-Antworten

Verschachtelt, wenn ... sonst Aussage

var number = 5
// outer if statement
if (number >= 0) {

  // inner if statement
  if (number == 0) {
      print("Number is 0")
  }

  // inner else statement
  else {
      print("Number is positive");
  }
}

// outer else statement
else {
    print("Number is negative");
}
SAMER SAEID

Verschachtelt, wenn ... sonst Aussage

using System;
 
namespace Conditional
{
	class Nested
	{
		public static void Main(string[] args)
		{
			int first = 7, second = -23, third = 13;
			if (first > second)
			{
				if (firstNumber > third)
				{
					Console.WriteLine("{0} is the largest", first);
				}
				else
				{
					Console.WriteLine("{0} is the largest", third);
				}
			}
			else
			{
				if (second > third)
				{
					Console.WriteLine("{0} is the largest", second);
				}
				else
				{
					Console.WriteLine("{0} is the largest", third);
				}
			}
		}
	}
}
SAMER SAEID

Ähnliche Antworten wie “Verschachtelt, wenn ... sonst Aussage”

Fragen ähnlich wie “Verschachtelt, wenn ... sonst Aussage”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen