Tic-Tac-Toe Puzzle to place numbers
You have to place all the digits from 1 to 9 without repeating any number in a tic tac toe board..
So, that the numbers should add up to 15 whether you add the numbers in each row, column or diagonally.
i Have found out elements using C program. Ans is
4 | 9 | 2
———-
3 | 5 | 7
———-
8 | 1 | 6
Here is the code.
#include < stdio.h >
#include < conio.h >
int main() {
int size = 3;
int matrix[3][3]; // = {{4,9,2},{3,5,7},{8,1,6}};
int row, column = 0;
int sum, sum1, sum2;
int flag = 0;
printf("nEnter matrix : ");
for (row = 0; row < size; row++) {
for (column = 0; column < size; column++)
scanf("%d", & matrix[row][column]);
}
printf("Entered matrix is : n");
for (row = 0; row < size; row++) {
printf("n");
for (column = 0; column < size; column++) {
printf("t%d", matrix[row][column]);
}
}
//For diagonal elements
sum = 0;
for (row = 0; row < size; row++) {
for (column = 0; column < size; column++) {
if (row == column)
sum = sum + matrix[row][column];
}
}
//For Rows
for (row = 0; row < size; row++) {
sum1 = 0;
for (column = 0; column < size; column++) {
sum1 = sum1 + matrix[row][column];
}
if (sum == sum1)
flag = 1;
else {
flag = 0;
break;
}
}
//For Columns
for (row = 0; row < size; row++) {
sum2 = 0;
for (column = 0; column < size; column++) {
sum2 = sum2 + matrix[column][row];
}
if (sum == sum2)
flag = 1;
else {
flag = 0;
break;
}
}
if (flag == 1)
printf("nMagic square");
else
printf("nNo Magic square");
return 0;
}

Superb (Y)
code is not even compiling !
Your Answer
More puzzles to try-
Ant and Triangle Problem
Three ants are sitting at the three corners of an equilateral triangle. Each ant starts randomly picks a direction and ...Read More »What’s her name?
A smooth dance, a ball sport, a place to stay, an Asian country, and a girl’s name. What’s her name?Read More »Find the Cat
Are You A Visual Detective? Find The Hidden Cat in This Optical Illusion!Read More »Time Measurement
How will you measure 15 minutes using two hourglasses of 7 minutes and 11 minutes respectively?Read More »Find “THE HIDDEN TIGER” Puzzle
Can you find “THE HIDDEN TIGER” in the picture?Read More »Unlock the Cipher
Decode below rebus D N A T S , DRead More »He has 9 eyes
He has 6 ears, 3 mouths, 9 eyes and 4 noses. What is he?Read More »Fox, Duck and Corn transportation Puzzle
A man transports a fox, a duck and corn in a boat. The boat is only capable of transporting himself ...Read More »Baseball Glove
What did the baseball glove say to the ball?Read More »CheckMate in Chess Puzzle
With the following rules: (A) White can make up to 10 legitimate moves until all kings are checkmate. (B) White ...Read More »Find the Code
During a secret mission, an agent gave the following code to the higher authorities AIM DUE OAT TIE MOD However, ...Read More »Finding gloves in dark riddle
A lady has some fine gloves and hats in her closet 14 blue,25 red and 45 yellow. The lights are ...Read More »Cutting the shape to get most pieces
Here is the picture of cross. You have to make two straight cuts across it. How do you cut it ...Read More »Spot the Girl Among Flamingos
Can You Spot the Girl Among Flamingos?Read More »Coin game with devil riddle
you die and the devil says he’ll let you go to heaven if you beat him in a game. the ...Read More »What is a word made up of 4 letters?
What is a word made up of 4 letters, yet is also made up of 3. Sometimes is written with ...Read More »Prison Break tactic riddle
Prison guards are bored so during dinner they announce the prisoners that they will play a game: In the morning ...Read More »How did he know?
One absent minded ancient philosopher forgot to wind up his only clock in the house. He had no radio, TV, ...Read More »Name 3 consecutive days puzzle
Can You Name Three Consecutive Days. Without Using The Words – Monday , Tuesday, Wednesday, Thursday, Friday, Saturday, Or Sunday?Read More »Life Line
It is as light as a feather, yet the strongest of men cannot hold it for more than a minute. ...Read More »