Answer:
#include <iostream>
#include <time.h>
#include <string>
using namespace std;
int main(){
srand(time(NULL));
cout<<"Throw dice"<<endl;
int b =0;
int a=0;
a=rand()%6;
b=rand()%6;
for (int i =0;i<1;i++)
{cout<<"dice one: "<<a<<endl;}
for (int i =0;i<1;i++)
{cout<<"dice two: "<<b<<endl;}
if(a>b)
{cout<<"first dice won"<<endl;}
if(b>a)
{cout<<"second dice won"<<endl;}
else{cout<<"they are same"<<endl;
return main();
}
return 0;
}
Explanation:
/*maybe it help you it is almost done*/
Not sure what quizScore1-5 is, but here it is. Also, I'm not entirely sure what language you're working with here, but null can't be returned as an integer. If it were a string, for example, it'd be possible as string is an object reference type.
public int getData(int dataNumber)
{
if (dataNumber == 1)
return quizScore1;
else if (dataNumber == 2)
return quizScore2;
else if (dataNumber == 3)
return quizScore3;
else if (dataNumber == 4)
return quizScore4;
else if (dataNumber == 5)
return quizScore5;
else
return 0;
}
Answer:
A.O(1)
Explanation:
In the implementation of queue by using linked chain the performance of the enqueue operation is O(1).We have to maintain two pointers one head and the other tailand for enqueue operation we have to insert element to the next of the tail and then make that element tail.Which takes O(1) time.
Answer:
The answer is Break
<u>Explanation:</u>
When break statement is occurred then, it immediately exits from the loop and executed the statement after the loop without raising any kind of error.
<u>The situation after entering of a value by a user
</u>
- If the user entered incorrect value then it will exit from the loop.
- If the user entered correct input value, then it will run the loop for the further values.