Follow us on FB

Thursday, May 30, 2013

mind guess game (interesting) in dev c++

#include<iostream>
#include<conio.h>
#include<string>
#include<ctime>
#include<cstdlib>
using namespace std;
int main(){
srand(time(0));
float g,r,l;
char op;
cout<<"\t\t.....M Haseeb Jaffur......."<<endl;
cout<<endl<<"Note:   'y' for next step and 'any no ' for exit game\t"<<endl;
cout<<"\nthink rupees (2 to 100) in your mind "<<endl;
cout<<"\t enter 'y' for next step: ";
cin>>op;
if(op=='y'|| op=='Y'){
   
r=rand()%50;
cout<<endl<<"1 . add my "<<r<<" rupees in your rupees";
g=r;
cout<<"\n\t enter 'y' for next step: ";
cin>>op;
if(op=='y'|| op=='Y')    {
r=rand()%50;
cout<<endl<<"2 . add "<<r<<" rupees of your friend ";
g+=r;
cout<<"\n\tenter 'y' for next step : ";
cin>>op;
if(op=='y' || op=='Y')        {
cout<<endl<<"3 . give half of the total to the mosque";
g/=2;
cout<<"\n\tenter 'y' for next step : ";
cin>>op;
if(op=='y' || op=='Y')
r=rand()%50;            {
cout<<endl<<"4 . give "<<r<<" rupees to a poor man";
g-=r;
cout<<"\n\tenter 'y' for next step : ";
cin>>op;
if(op=='y' || op=='Y')                {
cout<<endl<<"5 . give half of your thinking rupees to a child";
cout<<"\n\tenter 'y' for next step : ";
cin>>op;
if(op=='y' || op=='Y')
r=rand()%5;                    {
cout<<endl<<"6 . remaining rupees divided by 2 "<<endl;
g/=r;
cout<<"\n\tenter 'y' for next step : ";
cin>>op;
if(op=='y' || op=='Y')
r=rand()%50;                        {
cout<<"7 . add "<<r<<" in remaining rupees ";
g+=r;
cout<<"\n\t.....enter 'y' for your solution...... : ";
cin>>op;
if(op=='y' || op=='Y')                            {
cout<<endl<<"\n\t\t...Now your ramaining rupees is : "<<g;
    }}}}}}}}
if(op!='y'&& op!='Y'){
cout<<"...........thank you for visiting.......";
cout<<"\n.........you..have..no...rusult.......";
cout<<"\n*********you can get more fun if you complete the game********"<<endl;
}
system("pause");
}

Unknown

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.

0 comments:

Post a Comment

 

Copyright @ 2013 placeoflearn.