# 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

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!

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

#### Puzzle 2

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

#### 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);

#### Puzzle 4

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

#### Puzzle 5

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

Scroll to Top