Not Yet Answered # help in c++

Nick Evan 4,005 Discussion Starter ariesangel Nick Evan 4,005 Grigor 17 Discussion Starter ariesangel Nick Evan 4,005 Discussion Starter ariesangel

0

pls tell me how the rand() function work.

According to Cplusplus.com, rand() returns a pseudo-random integral number in the range 0 to RAND_MAX. This number is generated by an algorithm that returns a sequence of apparently non-related numbers each time it is called. This algorithm uses a seed to generate the series, which should be initialized to some distinctive value using srand.

And that's all you need to know about that.

Now for this:

urgent. as soon as possible.

If you hadn't waited for the last minute to start your homework, it wouldn't be urgent now would it?

Now next time you post:

- use code tags

- Create a meaningful title

- Ask a clear question

- Don't use words like 'urgent'

0

hello. thanxs.

can u pls conform this equation : any no from 0 to 9 are used and after module and add 1 store in x*. pls reply.*

According to Cplusplus.com, rand() returns a pseudo-random integral number in the range 0 to RAND_MAX. This number is generated by an algorithm that returns a sequence of apparently non-related numbers each time it is called. This algorithm uses a seed to generate the series, which should be initialized to some distinctive value using srand.

And that's all you need to know about that.

Now for this:

If you hadn't waited for the last minute to start your homework, it wouldn't be urgent now would it?Now next time you post:

- use code tags

- Create a meaningful title

- Ask a clear question

- Don't use words like 'urgent'

0

hello. thanxs.

can u pls conform this equation : any no from 0 to 9 are used and after module and add 1 store in x. pls reply.

Too vague.

What do you want? Do you want a random number between 0-9 or 1-10? How big is your x[] array? Where do you seed the random generator with `srand()?`

0

can u pls conform this equation : any no from 0 to 9 are used and after module and add 1 store in x. pls reply.

0

sorry for the disturb you. but i m big problem.

i make a sudoku game and for that i use this conditon to generate a random no bet o to 9.

i want to conform it takes a value by following code. i m new in programming. and donot know how to do this game. and i have only 4 days to complete it..

Too vague.

What do you want? Do you want a random number between 0-9 or 1-10? How big is your x[] array? Where do you seed the random generator with

`srand()?`

0

sorry for the disturb you. but i m big problem.

i make a sudoku game and for that i use this conditon to generate a random no bet o to 9.

All the sudoku's I've ever played had numbers from 1-9 and not 0-9, but whatever. Here's a small example that gives 1 random number in the range 1-9:

```
// Seed the generator. Do this ONLY ONCE
srand((unsigned)time(NULL));
cout << (rand() % 9) +1;
```

i m new in programming. and donot know how to do this game. and i have only 4 days to complete it..

If you're new in programming and this is your first assignment *and* you only got 4 days to finish it, you should complain to your teacher, not me.

But I guess that this isn't your first assignment right? And you probably got more then 4 days to finish it, true?

So, again: If you started earlier, you wouldn't have a problem now.

0

thank u niek for the help. i started this game 3 days ago, but to develop a logic my time is spent. i m not complain to u. and i m not a student i m a flash developer. i m new in development. this is my first task, and that's why i want to do my best to complete it. b'coz first impression is last imperssion.

All the sudoku's I've ever played had numbers from 1-9 and not 0-9, but whatever. Here's a small example that gives 1 random number in the range 1-9:

`// Seed the generator. Do this ONLY ONCE srand((unsigned)time(NULL)); cout << (rand() % 9) +1;`

If you're new in programming and this is your first assignment

andyou only got 4 days to finish it, you should complain to your teacher, not me.

But I guess that this isn't your first assignment right? And you probably got more then 4 days to finish it, true?

So, again: If you started earlier, you wouldn't have a problem now.

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"

Here is the sample output that I ...

Hello All ...

Iam Getting An Error With try to excecute the stored procedure .

I have Have Sql database , the stored procedure like so :

```
USE [MPRS]
GO
/****** Object: StoredProcedure [dbo].[Search_Licenses_By_Number] Script Date: 26-Nov-16 8:06:52 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE ...
```

I don’t want at this stage work on a big separate project as I've already got plenty ...