Answer to Question #23977 in C++ for Nourh

Question #23977
Write code that simulates the roll of two dice. If the two dice have the same value, output the statement "Doubles. Roll again." Otherwise, print "Your turn is over.";
1
Expert's answer
2013-02-11T11:39:33-0500
#include<iostream>
using namespace std;
& bool f(int a){
if(a>-1 && a<101)
return true;
else
return false;

}
int main (){
int a=1,b=1;

while(a==b)
{
a =rand() % (6)+1;
b=rand() % (6)+1;
cout<<a<<" "<<b<<"\n";
}

&
system("PAUSE"); &
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS