“Untuk orang lain” Kode Jawaban

Jika lagi pernyataan

var age=20;
if (age < 18) {
	console.log("underage");
} else {
	console.log("let em in!");
}
Poor Platypus

Untuk orang lain

# For else is used whether a code is or is not broken with 'break'
for i in range(5):
  if i == 3:
    break
  print(i)
else:
  print("The code was not broken") # This code is not executed
  
for i in range(5):
  if i == 7:
    break
  print(i)
else:
  print("The code was not broken") # This code does execute
    
Ninja Penguin

Jika lagi jika lagi untuk loop

using System;
 
class NumbersNotDivisibleByThreeAndSeven
{
    static void Main()
    {
        Console.WriteLine("Please enter your number: ");
        int n = int.Parse(Console.ReadLine());
 
        for (int i = 1; i <= n; i++)
        {
            if (i % 3 == 0)
            {
                continue;
            }
            else if (i % 7 ==0)
            {
                continue;
            }
            Console.Write("{0} ", i);
        }
        Console.WriteLine();
    }
}
Grieving Goose

Jawaban yang mirip dengan “Untuk orang lain”

Pertanyaan yang mirip dengan “Untuk orang lain”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya