answersLogoWhite

0


Best Answer

#include <iostream>

using namespace std;

void dice();

int main()

{

int x = 1;

while(x = 1)

{

srand(time(0));

cout << endl << "Enter 1 to Dice or 2 to exit: ";

cin >> x;

if(x == 1)

{

dice();

}

else

{

cout << "Enter 1 or 2!" << endl;

}

}

char wait;

cin >> wait;

return 0;

}

void dice()

{

cout << endl << "You diced " << (rand() % 6) + 1 << endl;

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c plus plus programm for dice game by using function?
Write your answer...
Submit
Still have questions?
magnify glass
imp