C Program: Kaun Banega Crorepati (KBC) (Who Will Become a Millionaire) Game – 2017

Crorepati (Who Will Become a Millionaire) is a game based on the television show kaun banega crorepati (Who Will Become a Millionaire) with the similar concept, it show questions on the output screen and ask the user to enter the correct answer number and is the answer is correct a message is appears on the screen showing the winning amount and the next question is presented else if the answer is wrong a message is displayed saying that the answer chosen by the user is not correct and hence the user loses.

We start by including the header files “stdio.h” and conio.h”.

After this, the program enters a for loop where the variable i=0 and it continues until the value of i is less than or equal to 10,  after entering the for loop the program enters switch case statements where every case contains a question of the game crorepati.

C Program: Kaun Banega Crorepati (KBC) (Who Will Become a Millionaire) Game - 2017
User is presented with the question in each case with 4 options as according to the format of the game and is asked to enter the correct answer which is saved in variable ‘n’ and then checked is the given answer is correct or not.

BTech Project C Program: Kaun Banega Crorepati (KBC) (Who Will Become a Millionaire) Game - 2017
If the answer is correct break statement is executed and the loop runs again and this time the value of i is equal to 2 which takes it to second case and similary to third and rest.
Free Download C Program: Kaun Banega Crorepati (KBC) (Who Will Become a Millionaire) Game - 2017

But if the chosen answer is not correct then the value of ‘i’ becomes 11 and then the break statement is executed which makes the for loop run again but this time the value of ‘i’ becomes 12 which is not present in any case and hence the default case is executed which makes the program exit the output screen.

Download Source Code – C Program Kaun Banega Crorepati KBC Game – 2017 -CodeWithC

LEAVE A REPLY

Please enter your comment!
Please enter your name here