random functions

A player will roll four dice .The
program must generate a random number between 1 and 6 for four different dice.Then the program must sort these four numbers in such a manner that the largest possible number is formed.the program must have at least two functions. One function called DICE_ROLL which generates and
returns a random number between one and six, and another called ARRANGE which takes four
parameters and returns the largest possible number

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

int main()
{
int dice_roll_1;
int dice_roll_2;
int dice_roll_3;
int dice_roll_4;

strand(time(null));
int randnum(6);
for(int i = 0, i < 5; i++)

{
randomNum[i] = getRandNumb();
cout << randomNum[x] << endl;
cout<< "dice_roll_1"<<endl;
cout<< "dice_roll_2"<<endl;
cout<< "dice_roll_3"<<endl;
cout<<"dice_roll_4"<<endl;
}
return 0;
}

int getRandNumb()
{
return 1 + rand% 54;
}


i need help cause my program compiles and it doesnt show me the output nor display the results.can anyone out there check it for me and help out.
That compiles?
it compiles but it doesnt execute
please be calm and think very carefully because in my view this is the easiest.
randomNum is undefined, x is undefined, dice_roll_1-4 are not initiated, randnum is not used. You sure it compiles?
Last edited on
srand() is misspelled as strand();
there is a comma after "int i = 0" in the for loop instead of a semicolon;
getRandNumb() was not declared prior to its invocation in main;
rand % 54 is missing parens, so is not calling the function;

...
Topic archived. No new replies allowed.