Hi ,
#include<stdlib.h>
#include<iostream.h>
void main()
{

char Area[][10]={"North","South","East","West"};

int ToGo;
for(int i=0; i<3; i++)
{
cout<<Area[ToGo]<<":";
}
This should solve your problem. You can probably explain the use of random
here though.


Thanks and regards,
Praveen S

On Thu, Mar 11, 2010 at 9:10 PM, sruthy_inuyasha <
[email protected]> wrote:

>
>
>
> #include<stdlib.h>
> #include<iostream.h>
> void main()
> {
> randomize();
> char Area[][10]={"North","South","East","West"};
> int ToGo;
> for(int i=0; i<3; i++)
> {
> ToGo = random(2)+1;
> cout<<Area[ToGo]<<":";
> }
>
> Outputs are
>
> North:South:East
> South:East:South
> South:East:East
>
> Can you tell me how North:South:East is possible?? I tried and I have no
> idea hw that output is possible. If it is possible how do I get it ( I
> meant the procedure)?
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]

Reply via email to