Explanation:
The word "of" in a fraction word problem USUALLY means to multiply. So we multiply 6 x 2/3
6 2 12
- x - = - = 4
1 3 3
Answer:
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
char Keep_Going = '-';
int nextBid = 0;
srand(5);
while (Keep_Going != 'n') { //<-- solution
nextBid = nextBid + (rand()%10 + 1);
cout << "I'll bid $" << nextBid << "!" << endl;
cout << "Continue bidding? ";
cin >> Keep_Going;
}
cout << endl;
return 0;
}
Answer:
int main()
{
int number;
printf("Enter a number: ");
scanf_s("%d", &number, sizeof(number));
for (int i = 1; i <= 2; i++) {
printf("%d*%d=%d\n", number, i, number * i);
}
}
Explanation:
I used the safe scanf_s() that takes a third parameter to indicate the size of the buffer. In this case it is the size of an integer.