Write a single instruction that will store an EVEN random
integer between 54 and 212 inclusive in the variable myran.
(NOTE only generate EVEN random numbers)



Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in ..

Answer / Aditya Pratap Singh

myrand = (rand() % (212 - 54 + 1)) + 54; while (myrand % 2 != 0) myrand++;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How are Structure passing and returning implemented by the compiler?

1 Answers  


What is virtual destructor? What is its use?

1 Answers  


What is an orthogonal base class in c++?

1 Answers  


What is meant by entry controlled loop? What all C++ loops are exit controlled?

1 Answers   TCS,


i want the NIC programmer-B model papaer pattren, iwant the all model papers?

15 Answers   NIC,


What are c++ storage classes?

1 Answers  


If there are 1 to 100 Numbers in array of 101 elements. Which is the easy way to find repeated number?

2 Answers   Persistent,


What is singleton class in c++?

1 Answers  


Differentiate between an array and a list?

1 Answers  


Differentiate between a pointer and a reference with respect to c++.

1 Answers  


Name four predefined macros.

1 Answers  


What is std :: flush?

1 Answers  


Categories