Write a short compiled module which selects random numbers?



Write a short compiled module which selects random numbers?..

Answer / Sunil Kumar Sharma

Here's a simple example of a C++ module that generates random numbers using the rand() function. Save it as 'randomNumbers.cpp':nn```n#include <iostream>n#include <cstdlib>n#include <ctime>nnint main() {n srand(time(0));n int randomNumber = rand();n std::cout << randomNumber << stdn;n return 0;n}n``` Compile it using g++ -o randomNumbers randomNumbers.cpp and run it with ./randomNumbers.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Automation Testing AllOther Interview Questions

What type of scenarios can't be automated?

1 Answers  


How can the user get a text of a web element?

1 Answers  


How could you explain the main difference between webdriver and rc?

1 Answers  


Does Microsoft Corporation, Sun Microsystems possesing any maturity levels?if yes, what is that level?

1 Answers   CTS,


how to know whether the user information or any other information which is entered in to the web is storing in secured place or non secured place?

1 Answers  


How to open an application through scripting in QTP? Give me Syntax and example please

2 Answers  


Explain some disadvantages to manual software testing?

1 Answers  


Explain load testing on websites?

1 Answers  


Where you have applied oops in automation framework?

1 Answers  


what is 2 tier and 3 tier application.

3 Answers   Value Labs,


how is mind q venkat training in testing for weekend or general batches.and any other good institutes in ameerpet

1 Answers  


How do you decide which tool you have to use?

1 Answers  


Categories