Actually I wanna know why North:South:East came. I have no idea how. This is 
CBSE 2008 question and same kind of question appears every year..How do I find 
the output? 
  
________________________________
From: Praveen S <[email protected]>
To: [email protected]
Sent: Fri, 12 March, 2010 9:43:31 AM
Subject: Re: [c-prog] Random()

  
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 <
sruthy_inuyasha@ yahoo.co. in> 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]





      Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! 
http://downloads.yahoo.com/in/internetexplorer/

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

Reply via email to