Js

//1

// var karen = 5

// var poxos = 5

// document.write(poxos + karen);    

//2

// var poghos = «b»

// var karen = «arev»

// document.write(poghos + karen);

// var mirg = [«xndzor», «apelsin», «mandarin», «banan», «dexdz»]

// document.write(mirg[2]);

// var tari=prompt(«Ներմուծեք տարին»);

// tari = parseInt(tari);

// switch (tari)

// {

Читать далее

TT

(Եթե թիվը բաժանվում է 3-ի պետք է գրվի (Fizz), կամ եթե բաժանվի 5ի գրի (Buzz) իսկ եթե չբաժանվի 3-ի կամ 5-ի գրի (Fizzbuzz))

using System;

public class HelloWorld

{

    public static void Main(string[] args)

    {

        for (int i = 1; i <= 15; i++){

            if (i % 3 == 0) Console.Write(«Fizz»);

            else if(i % 5 == 0) Console.Write(«Buzz»);

            else if(i % 15 == 0) Console.Write(«Fizzbuzz»);

            else Console.Write(i);

        }

    }

}

TT

Example 1

Rock, paper, scissors

Console.WriteLine(«Enter hand:»);
string userName = Console.ReadLine();
string userName1 = Console.ReadLine();

   if(userName == «tuxt» && userName1 == «qar»){


      Console.WriteLine(userName);


   }else if(userName == «tuxt» && userName1 == «mkrat»){
      Console.WriteLine(userName);
   }else if(userName == «qar» && userName1 == «mkrat»){
      Console.WriteLine(userName);
  }
}

Example 2
Console.WriteLine(«Գրիր քո տարիքը և իմացիր 100 տարի հետո, որ թիվ կլինես»);
int tariq = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(2022 — tariq + 100);

Example 3

Եթե թվերի մեյ կա մեր ուզած թիվը ապա կրի (կա)

 int[] num = {1, 2, 3, 4, 5, 6, 7};
// int x = Convert.ToInt32(Console.ReadLine());
// for (int i = 0; i < num.Length; i++){
// if(num[i] == x){
// Console.WriteLine(«կա»);
// }
// }

// }
// }

Example 4

using System;


  namespace palindromecheck {
     class Program {


        static void Main(string[] args) {
  string string1, rev;
   string1 = «Malayalam»;
  char[] ch = string1.ToCharArray();
   Array.Reverse(ch);


   rev = new string(ch);
  bool b = string1.Equals(rev, StringComparison.OrdinalIgnoreCase);

         if (b == true) {
         Console.WriteLine(«» + string1 + » is a Palindrome!»);
         } else {
            Console.WriteLine(» » + string1 + » is not a Palindrome!»);
         }
         Console.Read();


      }
   }
}

//Ստեղծեք ֆունկցիա, որը կստուգի թե քանի հատ true կա arrayi մեջ

// let arr = [true, false, true, true];

// let patasxan = arr.filter(Boolean).length;

// console.log(patasxan);