SECOND BASIC C++ PROGRAM
A very cool program made from C++ with password and username protection. In it there are many type of things like Quiz , Logical Questions , Astronomical Questions and many more. If You Like It then comment and share Knowledge with us in our discussion area .
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<graphics.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main (void){
clrscr();
textbackground(RED);
clrscr();
cout<<"\n\n\n\n\n";
cout<<"\n * * ***** * *** *** * * *****";
cout<<"\n * * * * * * * * * * *";
cout<<"\n * * * **** * * * * * * * ****";
cout<<"\n * * * * * * * * * * * *";
cout<<"\n * * ***** **** *** *** * * *****";
getch();
cout<<"\n\n";
cout<<"\n\t * * *** * *";
cout<<"\n\t * * * * * *";
cout<<"\n\t * * * * *";
cout<<"\n\t * * * * *";
cout<<"\n\t * *** *****";
getch();
textbackground(BLACK);
textcolor(WHITE);
clrscr();
char user[20], pass[20];
cout<<"\n Enter The USERNAME : ";
cin>>user;
cout<<"\n Enter The Password : ";
cin>>pass;
if((strcmp(user, "saharsh")==0)&&(strcmp(pass, "fixproblem")==0)||(strcmp(user,"saharsh")==0)&&(strcmp(pass,"gupta")==0))
{
cout<<"\n\n Welcome To The Programme "<<endl;
}
else
{
cout<<"\n\n You Cheater Go Away \t\n\n ";
getch();
system ("PAUSE");
return 0;
}
getch();
textbackground(BLUE);
textcolor(WHITE);
clrscr();
char b[50],c[50];
cout<<"\n\n Enter Your First Name ";
cin>>b;
cout<<"\n\n Enter Your Last Name ";
cin>>c;
cout<<"\n\n Welcome ";
cout<<b<<" ";
cout<<c;
getch();
clrscr();
long float a,ad,aa,ac,table;
cout<<"\n\n Enter A Number To Get Its Table = ";
cin>>a;
cout<<"\n\n Till Which Number = ";
cin>>ac;
ad=1;
while(ad<=ac)
{
table=ad*a;
ad++;
cout<<endl<<" "<<table;
}
getch();
clrscr();
long float s;
cout<<"\n\n Enter A Number To Get It's Square = ";
cin>>s;
cout<<"\n\n The Square Of The Number You Entered Is = "<<s*s;
getch();
clrscr();
float ab,r;
cout<<"\n\n Enter A Number To Get It's Square Root - ";
cin>>ab;
r=sqrt(ab);
cout<<"\n\n The Square Root Of The Number You Entered Is = "<<r;
getch();
clrscr();
int four,ba,bb,bc,bd;
cout<<"\n\n Enter A 4 Digit Number - ";
cin>>four;
ba=four/1000;
bb=(four%1000)/100;
bc=(four%1000)%100/10;
bd=four%10;
cout<<"\n\n The Reversed Number Is = "<<bd<<bc<<bb<<ba;
getch();
clrscr();
long float original,power;
cout<<"\n\n Now You Are In Exponents And Powers Section ";
cout<<"\n\n Enter A Number = ";
cin>>original;
cout<<"\n\n Now Till Which Power Do You Want It = ";
cin>>power;
power=pow(original,power);
cout<<"\n\n "<<power;
getch();
clrscr();
char d;
cout<<"\n\n Now I Will Test YourKnowledge ";
cout<<"\n\n Here Is A Good Quiz ";
cout<<"\n\n Which Of The Following Is A Programming Language ?";
cout<<"\n\n 1) C++ \n\n 2) FLASH \n\n 3) PHOTOSHOP \n\n 4) SONY VEGAS ";
cout<<"\n\n Your Option Is = ";
cin>>d;
if (d=='1')
{
cout<<"\n\n You Got It \n";
}
else
{
cout<<"\n\n Sorry, Please Try Again Later \t\n\n ";
getch();
system ("PAUSE");
return 0;
}
clrscr();
char e;
cout<<"\n\n Got It Right So Now Answer This ";
cout<<"\n\n Which Of The Following Is Not A Planet ";
cout<<"\n\n 1)cerium \n\n 2)Jupiter \n\n 3)Saturn \n\n 4)Plutonium";
cout<<"\n\n Your Option Is = ";
cin>>e;
if (e=='4')
{
cout<<"\n\n You Are Brilliant "<<endl;
}
else
{
cout<<"\n\n You Lost \t\n\n "<<endl;
getch();
system ("PAUSE");
return 0;
}
getch();
clrscr();
char f;
cout<<"\n\n You Are Just Brilliant ";
cout<<"\n\n Now Tell This ";
cout<<"\n\n When Will Windows 8 Launch ";
cout<<"\n\n 1)2013 \n\n 2)2012 \n\n 3)2014 \n\n 4)2011 ";
cout<<"\n\n Your Option Is = ";
cin>>f;
if(f=='2')
{
cout<<"\n\n You Are Right "<<endl;
}
else
{
cout<<"\n\n Oh No You lost The Game\t\n\n "<<endl;
getch();
system ("PAUSE");
return 0;
}
getch();
clrscr();
char g[50];
cout<<"\n\n Check This Out ";
cout<<"\n\n Solve This Puzzle ";
cout<<"\n\n Use Any Of The Four Operations (+,-,*,/) And Solve This";
cout<<"\n\n 1,3,4,6";
cout<<"\n\n Make 24 Out Of This\n\n";
gets(g);
if((strcmp(g, "6/(1-3/4)")==0))
{
cout<<"\n\n You Are Brilliant "<<b<<" "<<c;
}
else
{
cout<<"\n\n I Knew That You Can't Do This "<<b<<" "<<c;
cout<<"\n\n Bye Byeee You Duffer ";
getch();
exit(1);
}
getch();
clrscr();
cout<<"\n\n You Won The Quiz ";
cout<<"\n\n For Your Prize Of Rupees 1 Crore ";
cout<<"\n\n Please Contact : ";
cout<<"\n\n\t\t Mr.Bill Gates";
cout<<"\n\n\t\t Mobile No. ********** ";
getch();
clrscr();
cout<<"\n\n\n Just Wait For New Questions To Be Added........ ";
getch();
clrscr();
cout<<"\n\n Thanks For Using This "<<b<<" "<<c;
cout<<"\n\n Made By Saharsh Gupta ";
getch();
clrscr();
cout<<"\n\n See You Soon "<<b<<" "<<c;
getch();
return 0;
}
-by Saharsh
nice one man really i m telling it world is need a developer like u who is very school going kid and write such a nice programm :) :)
ReplyDeleteThanks maddy
ReplyDelete