Answer to Question #63327 in C++ for helmi

Question #63327
(im bad at english)
how do u code for choice using programming c++
i.e. what shoes do u want to buy
1)heels
2)without heels

such like tht
1
Expert's answer
2016-11-19T06:05:10-0500
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
char choise='\0';
cout<<"what shoes do u want to buy?"<<endl;
cout<<"1)heels\n 2)without heels"<<endl;
cout<<"Your choise: ";
cin>>choise;
if(choise=='1')
{

//u`ve selected shoes with heels
}
else if(choise=='2')
{
//u`ve selected shoes without heels
}
else
{
//invalid input.
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS