Question: [c++ programming Error Question] When I tried to print out random number some weird number comes out sometimes 444444444----- , 55555555----, 6666----- . How to
[c++ programming Error Question]
When I tried to print out random number some weird number comes out sometimes 444444444----- , 55555555----, 6666----- . How to fix this error?![[c++ programming Error Question] When I tried to print out random number](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66ef979c450fd_94766ef979be9815.jpg)
Also, the first array element should be 998 but it read only 98.
here is my code
#include#include #include using namespace std; class random { private: double num; public: random() {} void allValues() { } void sumValues() { } void oddValue() { } void evenValue() { } void middleValue() { } void firstValue() { } void lastValue() { } void highestValue() { } void lowestValue() { } void sortValue() { } void linearSearch() { } }; int main() { int ranNum; //random number const int arraySize = 1000; // Array size int array[arraySize]; ofstream outfile; outfile.open("randomfile"); srand(time(0)); for(int i =0; i> array[i]; } file.close(); cout 594 255 640 979 594 255 640
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
