KBC USING C++ LANGUAGE

 CPP CODE:

#include<iostream.h>
#include<stdlib.h>
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<process.h>
#include<dos.h>
#include<stdlib.h>
#include<string.h>
main()
{
char ans;
char a[25],b[23];
abc:
clrscr();
textcolor(56);
textbackground(67);
cout<<" Enter your Password : ";
gets(a);
if(strcmp(a,"learn2code")==0)
{
clrscr();
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
cout<<"Loading please wait..."<<endl;
for(int x=0; x<80; x++)
{
cout<<char(221);
delay(90);
}
cout<<"\nCompleted";
delay(2000);

clrscr();
textcolor(104);
textbackground(90);
cout<<"\n\n\n\n\n\n\n\t\t\t\t WELCOME TO KBC";
cout<<"\n\t\t\t\t (learn 2 code) ";
delay(2000);
clrscr();
textcolor(26);
textbackground(78);
cout<<"\n Q1. Python was developed by";
cout<<"\n A. Guido van Rossum ";
cout<<"\n B. James Gosling";
cout<<"\n C. Dennis Ritchie";
cout<<"\n D. Bjarne Stroustrup";
cout<<"\n\n ";
cin>>ans;
switch(ans){
case 'a':

{
cout<<" Yes,Python was developed by Guido van Rossum";
delay(2000);
clrscr();
textcolor(40);
textbackground(48);
cout<<"\n Q2. Python is written in which language ?";
cout<<"\n A. C";
cout<<"\n B. C++";
cout<<"\n C. Java";
cout<<"\n D. None of the above";
cout<<"\n\n ";
cin>>ans;
switch(ans){
case 'a':

{
cout<<" Yes,Python is written in c language";
delay(2000);
clrscr();
textcolor(87);
textbackground(32);
cout<<"\n Q3. What is used to define a block of code in python ?";
cout<<"\n A. Parenthesis";
cout<<"\n B. Indentation";
cout<<"\n C. Curly braces";
cout<<"\n D. None of the above";
cout<<"\n\n ";
cin>>ans;
switch(ans){
case 'a':

{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 2/3";
delay(2000);
exit(0);
}
break;

case 'b':

{
cout<<" Yes, Python uses indentation to define block of code.";
cout<<"\n Your score is 3/3";
delay(2000);
exit(0);
}
break;

case 'c':
{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 2/3";
delay(2000);
exit(0);
}
break;

case 'd':
{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 2/3";
delay(2000);
exit(0);
}
break;
default:
{
cout<<" Invalid Input";
delay(2000);
exit(0);
}
break;
}
}
break;

case 'b':

{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 1/3";
delay(2000);
exit(0);
}
break;

case 'c':
{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 1/3";
delay(2000);
exit(0);
}
break;

case 'd':
{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 1/3";
delay(2000);
exit(0);
}
break;
default:
{
cout<<" Invalid Input";
delay(2000);
exit(0);
}
break;
}
}
break;

case 'b':

{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 0/3";
delay(2000);
exit(0);
}
break;

case 'c':
{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 0/3";
delay(2000);
exit(0);
}
break;

case 'd':
{
cout<<" No, Your ans is incorrect";
cout<<"\n Your score is 0/3";
delay(2000);
exit(0);
}
break;
default:
{
cout<<" Invalid Input";
delay(2000);
exit(0);
}
break;
}
}
else
cout<<"\n Your Password is incorrect";
cout<<"\n Do you want to continue (yes/no) ? ";
gets(b);
if(strcmp(b,"yes")==0)
goto abc;
else
exit(0);
getch();
}

OUTPUT:




Comments

Followers

Popular posts from this blog

HOSTEL MANAGEMENT SYSTEM BY PYTHON

SCREENSHOT USING PYTHON

Contact form

Name

Email *

Message *