Coding Quiz – Win a Prize

   Coding Quiz –  Learn To Read Code

TalkIT continues its coding puzzle series with more challenging brainteasers. Learn to read code with 5 new C# loops. This time we are running a quiz. In order to encourage you we are giving away 5 Gold Subscriptions for one month, to those lucky ones who solve these puzzles. You can use some of our coding tutorials to get some help and practice with our previous puzzles.

What do you have to do?

  1. Register on TalkIT Website
  2. Solve these 5 quizzes and put correct answers into Google form which is in the bottom of this page.
  3. Share and spread the word about us

 

If you have solved them all correctly we will enter you into the lottery.

Deadline for competition is 12th of July. On Thursday 16th July we will release results and notify the winners.

Good luck!

QUIZ

Coding quiz. What is the output from these loops?          

Puzzle 1

            for (int p = 0; p < 4; p++)
            {
                for (int q = 0; q < 4; q++)
                {
                    Console.Write(p * q);
                }
            }
            Console.ReadLine();

Puzzle 2

            for (int p = 0; p < 4; p++)
            {
                for (int q = 0; q < 4 – p; q++)
                {
                    Console.Write(p – q);
                }
            }
            Console.ReadLine();

Puzzle 3

            int[] a = { 9, 8, 7, 10, 4, 6, 5, 1, 3, 2 };
            int t = a[1];
            for (int i = 0; i < 9; i++)
            {
                if (t < a[i])
                {
                    t = a[i];
                }
            }
            Console.Write(t);
            Console.ReadLine();

Puzzle 4

            float j = 1, k = 1;
            for (int i = 0; i < 100000; i++)
            {
                k = k / 2;
                j += k;
            }
            Console.Write(j);
            Console.ReadLine();
            if (Test(17)) Console.Write(“True”);
            Console.ReadLine();
        }

Puzzle 5

        static bool Test(int number)
        { 
            for (int i = 2; i < number; i++)
            {
                if (number % i == 0)
                {
                    return false;
                }
            }
            return true;
        }

keep-calm-and-learn-to-code-10
Scroll to Top
Share via
Copy link