Coding Quiz – Win a Prize

[vc_row][vc_column width=”1/1″][vc_column_text]

   Coding Quiz –  Learn To Read Code

[/vc_column_text][vc_column_text]

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.

[/vc_column_text][vc_column_text]

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

 [/vc_column_text][vc_facebook type=”standard”][vc_googleplus type=”” annotation=”bubble”][vc_tweetmeme type=”horizontal”][vc_column_text]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![/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_single_image image=”9359″ border_color=”grey” img_link_large=”” img_link_target=”_self” img_size=”245×202.5″ alignment=”center”][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]

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;
        }

[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_raw_html]JTNDcCUzRSUzQ2lmcmFtZSUyMHNyYyUzRCUyMmh0dHBzJTNBJTJGJTJGZG9jcy5nb29nbGUuY29tJTJGZm9ybXMlMkZkJTJGMTRZMTJ3WmFJbDltME85ZDB3ZzZ5NkEzdUtlZ3VzSTM4QjhGc0pYQ21aUGslMkZ2aWV3Zm9ybSUzRmVtYmVkZGVkJTNEdHJ1ZSUyMiUyMHdpZHRoJTNEJTIyNzYwJTIyJTIwaGVpZ2h0JTNEJTIyNTAwJTIyJTIwZnJhbWVib3JkZXIlM0QlMjIwJTIyJTIwbWFyZ2luaGVpZ2h0JTNEJTIyMCUyMiUyMG1hcmdpbndpZHRoJTNEJTIyMCUyMiUzRUxvYWRpbmcuLi4lM0MlMkZpZnJhbWUlM0UlM0MlMkZwJTNF[/vc_raw_html][/vc_column][/vc_row][vc_row][vc_column width=”1/1″][vc_single_image image=”9358″ border_color=”grey” img_link_large=”” img_link_target=”_self” alignment=”center” img_size=”300×450″][/vc_column][/vc_row]

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top