badge

C++ Program to Implement Bollywood Quiz Game



          C++ Program to Implement Bollywood  Quiz Game 

Here is the C++ Program to Implement Bollywood Quiz Game  program  As we know that we play this game in our childhood. So i think about this in converting into programming language. So i Made this in C++ Program

Source Code

#include<iostream>
#include<conio.h>
#include<string.h>
using namespace std;
int main()
{
          
          
          char a[50],b[50],ch,ca[50];
          int count=9,c=0,i,e=0;
          
          cin>>a;
          cout<<a;
          system("cls");        
          for(i=0;i<strlen(a);i++)
          {
                          if(a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u')
                          {
                                 b[i]=a[i];
                          }
                          else
                          if(a[i]==' ')
                          b[i]='!';
                          else
                          b[i]='*';
          }
          
          for(i=0;i<strlen(a);i++)
          {
                          cout<<b[i];
          }
          for(i=0;i<strlen(a);i++)
          {
                          ca[i]=a[i];
          }
          
          
          cout<<"\nenter character";
          cin>>ch;
          
          while(count!=0 && e<strlen(a))
          {
                         if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')
                         {
                            count--;
                         }
                         c=0,e=0;             
                         for(i=0;i<strlen(a);i++)
                         {
                                         if(ca[i]==ch)
                                         {  
                                             b[i]=ch;
                                             c++;
                                             ca[i]='0';
                                         }
                         }
                         
                         
                         if(c==0)
                                 { count--;
                                  cout<<"\nWrong Character";
                                 }
                                 else
                                 {
                                   for(i=0;i<strlen(a);i++)
                                       {
                                         cout<<b[i];
                                         }
                                  }
                                  
                                  if(e==0)
                                  {
                                  for(i=0;i<strlen(a);i++)
                                  {
                                       if(a[i]==b[i] || (a[i]==' ' && b[i]=='!'))
                                                  
                                                  {
                                                                e++;
                                                  }
                                                  
                                  }
                         
                             }
                             if(e<strlen(a))
                             {
                         cout<<"\n"<<count<<" chance remaining";
                         cout<<"\nEnter Another Character\n";
                         cin>>ch;
                         }
          }
          
          
         
          if(e==strlen(a))
          cout<<"\n!!!!YOU WIN!!!!";
          else 
          cout<<"\n!!!!U LOSE!!!!";
          
          
getch();
}


OUTPUT OF THE PROGRAM


You can Also Read , Like and Share our Related Posts


1. C++ Program and Project to implement Library Management System

2. C++ Program to Implement the operation in BINARY SEARCH TREE (BST)

3. C/C++ program to implement tower of Hanoi Problem Using Recursion

4. C++ program to implement PRIORITY QUEUE PROGRAM



1. Motorola 3rd Generation Smartphone Moto G3 Price and Specification Leaked

2. Video Messenger Of Yahoo for IOS -Yahoo's LiveText

3. Airtel is launching Branded Airtel 4G smartphones at Rs 4000













SHARE

Admin

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments: