Question: Which is the correct way to generate numbers between minimum and maximum(inclusive)?

Options

A : minimum + (rand() % (maximum – minimum));

B : minimum + (rand() % (maximum – minimum + 1));

C : minimum * (rand() % (maximum – minimum))

D : minimum – (rand() % (maximum + minimum));

Click to view Correct Answer

Previous || Next

C Programming Random Number Generation 1 more questions

What is the value of current in an inductive circuit....

_______ cement content to avoid shrinkage cracking due to temperature....

_________ cement content to avoid shrinkage cracking due to temperature....

__________ water-cement ratio content to give adequate durability for the....

___________ water-cement ratio content to give adequate durability for the....

The compressive strength of the brick should be:

Which of the following is similar to the high and....

In free space, the condition that holds good is

Which of the following is not a requirement of transmission....

The central plane of the crankpin is subjected to which....

Chemical Engineering Basics - Part 1 more Online Exam Quiz

C Programming Pointers Vs Multi Dimensional Arrays 2

C Programming Questions And Answers Structures Functions

C Programming Questions Goto Labels

C Programming Questions Macro Substitution

C Programming Questions Static Variables

C Programming Self Referential Structures 1

C Programming Sizeof Keyword 1

C Programming Sizeof Keyword 2

C Programming Storage Management 1

C Programming String Operations