Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

C++ program to create a game [Find Hidden Word]

YASH PAL, 31 July 202419 February 2026

In this post, we will write a C++ program to create a game [Find Hidden Word]. The first user will enter a word that is not more than 10 characters long. after that in that he will enter a character and the program will check if that character is available in the word. if the character is available then the program will print that character. as you could see in the below given image in output section 

C++ program to create a game [Find Hidden Word]

C++ program to create a game [Find Hidden Word]

#include<iostream>
#include<conio.h>
#include<windows.h>

BOOL gotoxy(const WORD x, const WORD y) {
    COORD xy;
    xy.X = x;
    xy.Y = y;
    return SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), xy);
}


int main()
{
    system("cls");

    char a[10],b[10];
    int i,n,j,k,p,no;

    std::cout<<"Enter the word of maximum ten characters = ";
    std::cin>>a;

    system("cls");

    k=0;

    while(a[k] != '')
    {
        gotoxy(40+k,3);
        std::cout<<"-";
        k++;
    }

    no = k*2;
    gotoxy(70,1);
    std::cout<<no;
    p=0;

    for(int m=1;m<=2;m++)
    {
        i=0;

        while(a[i] != '')
        {
            gotoxy(1,1);
            std::cout<<"Enter any character = ";
            b[i] = getch();

            if(b[i] == a[0])
            {
                gotoxy(40,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[1])
            {
                gotoxy(41,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[2])
            {
                gotoxy(42,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[3])
            {
                gotoxy(43,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[4])
            {
                gotoxy(44,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[5])
            {
                gotoxy(45,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[6])
            {
                gotoxy(46,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[7])
            {
                gotoxy(47,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[8])
            {
                gotoxy(48,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            if(b[i] == a[9])
            {
                gotoxy(49,3);
                std::cout<<b[i]<<std::endl;
                p++;
            }
            no--;
            gotoxy(70,1);
            std::cout<<no;
            i++;
            gotoxy(1,1);
        }
    }

    std::cout<<"Your correct sentence = "<<a;

    getch();
    return 0;
}

Output

C++ program to create a game [Find Hidden Word]

C++ Programming Tutorials coding problems solutions C++ ProgramsPrograms

Post navigation

Previous post
Next post

Leave a Reply

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

C++ Program to print a message on the screen
Project - Library Management System Program in C++
C++ Program to calculate the salary of the servant
C++ Program to find out the grades of given marks
C++ Program to find out the greater number from given numbers
C++ Program to find out whether the given number is odd or even
C++ Program to inherit derived constructor
C++ Program to display the reverse of a given number
C++ Program to print the ASCII value of a character
C++ Program to convert temperature from Fahrenheit to centigrade
C++ Program to enter two numbers and show their sum
C++ Program to swap two numbers using third variable
C++ Program to calculate the result of students using marks
C++ game to find out a number
C++ Program to print the table of a number
C++ Program to find out the smallest number from given numbers
C++ Program to calculate the factorial of a given number
C++ Program to select an operation from a list and display its results
C++ Program to generate a random number in circles and find out the sum
C++ Program to solve arithmetic operations
C++ Program to convert the dollar into different currencies
C++ Program to display the given number in roman number
C++ Program to find out whether the given character is a vowel or not
C++ Program to use symbols as words using preprocessor Directives
C++ Program to calculate the age of a human by entering the date of birth
C++ Program to convert the upper to lower and lower to upper case letters
C++ Program to calculate the electricity bill of consumed units by the user
C++ Program to convert the small case letters to upper case letters
C++ Program to find out the nth term of its factorial
C++ Program to search for a number from a list by sequential search
C++ Program to find out the exponent of a given number
C++ Program to sort characters in ascending order by using bubble sort
C++ Program to display the text in different colours
C++ Program to convert the decimal number into a binary number
C++ Program to find out the day of the given date, starting from Jan 2001
C++ Program to find out the maximum number from an array
C++ program to display the ASCII values
C++ Program to calculate the area of a room
C++ Program to print students' details using a structure
C++ Program to display a stopwatch on screen for 2 minutes
C++ Program to print a diamond pattern of stars
C++ Program to display the pattern of alphabets
C++ Program to find out the factors of a given number
C++ Program to display the sum of mathematics series
C++ Program to create a game [Find Hidden Word]
C++ Program to display the rectangle on the screen
C++ Program to sort the numbers using selection sort
C++ Program find out whether the given number is prime or not
C++ Program to sort the numbers using insertion sort
C++ Program to display a word in the middle of the screen
C++ Program to create a puzzle game
C++ Program to find out Armstrong numbers from 1 to 500
C++ Program to compare two strings
C++ Program to calculate the number of characters in the given string
C++ Program to calculate the standard deviation of a given range
C++ Program to open a file in binary mode and then get data in that file
C++ Program to use the setw function
C++ Program to create a file in binary mode and then put data in that file
C++ Program to display the Fibonacci series using a function
C++ Program to count the characters, tabs, and vowels in a line from a file
C++ Program to find out the raise to a power using recursion
C++ Program to copy data from one file to another file
C++ Program to find out the prime numbers from a given range
C++ Program to count the number of lines in a file
C++ Program to calculate the square root of a given number
C++ Program to copy a string into a file, then read it and display it on the screen
C++ Program to print the values of a pointer character array
C++ Program to create a file in text mode, write and then read data from the file
C++ Program to access the value of a variable using a pointer
C++ Program to use a friend class
C++ Program to display the address of a variable
C++ Program to display the distance in feet and inches
C++ Program for Matrix Multiplication
C++ Program to use a destructor
C++ Program to create user define header file
C++ Program to calculate the multiplication of two numbers without using the * symbol
C++ Program to find out the smallest number from the given numbers
C++ Program to search a record from a file
C++ Program to search a record from a binary file
C++ Program to open a file in binary mode and count the total records
C++ Program to inherit the class
C++ Program to overload binary operators
C++ Program to overload [] binary operator
C++ Program for binary operator overloading
C++ Program to display the file using the command line of the compiler
C++ Program to update the record in binary mode
C++ Program to search the record in binary file
C++ Program to display a message by using multiple virtual functions
C++ Program to display a message by using a virtual function
C++ Program to multiply three numbers using a friend function
C++ Program to override a function

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes