juz want to ask
if i write like this
cout<< ' \n 1-package a \n2- package b " ;
then what should i put in cin??

5 Years
Discussion Span
Last Post by frenzra

Sorry your question does not make sense. How can we know what you want to pass to cin?...also, you open the "string" with a ' and close with a ".


i mean that
i juz put the package as at declaration
for easy my work, i use no to help customer to choose the packages
that's y i cout<< "\n1-package A \n2- package B" ;
then i dun know what should i put in cin


You dont put things in cin. cin is a stream operator; you use it to extract elements from a stream.

As an aside, the language of your post will (in the general case) cause less people to respond seriously. 'Q' is not a suitable substitution for 'Question'; juz is not a word and should not be used in place of just; randomly dropping letters is not appropriate. This is, of course, only my opinion - you can feel free to discard it as you see fit.

Votes + Comments
I put the title in when I split it from a hijack...

I believe he is trying to do this:

#include <iostream>

using namespace std;

char Package;

int main()
  cout<<"Choose a package: 1 = Package A, 2 = Package B\n";
  cin>>Package;                         //This is how u get the user choice..

  if(Package == '1')                    //I guess u mean split choice by if and else meaning if this then... else...
    //Do stuff
  else if(Package == '2')               //The If and else statement will let do something depending on the choice made.
    //Do stuff
return 0;

Edited by triumphost: n/a

Votes + Comments
Global variable = bad, bad, bad.
And why do his homework for him?
bad code
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.