When is answer going to equal answer*17? Only when answer is zero. Is that what you wanted, or did you mean
if(answer== SECRET *number) ?
printf("What is %i*%i?", SECRET, number, answer);
Two %i but three values to be placed into those two %i. This doesn't seem right.
scanf("%i", SECRET, &number, &answer);
One %i, so you should provide one memory address. You've provided the number 17 and two memory addresses.
while (number_wanted> 0)
You never change number_wanted so this will run forever.
Use C++. Functions have been provided for you so you dno't have to mess around getting printf and scanf wrong. Here are some example functions.
1 2 3 4 5 6 7 8 9
#include <iostream>
int main()
{
int number;
constint SECRET = 17;
std::cin >> number; // This will take an int from the console and put it into number. No need to get scanf wrong
std::cout << "What is " << SECRET << " * " << number; // No need to get printf wrong
return 0;
}
I'm using a basic C complier. I'm still having some trouble the program runs by giving me a multiplication problem but it does not output if the answer is right or wrong. Any suggestions???
I'm using a basic C complier. I'm still having some trouble the program runs by giving me a multiplication problem but it does not output if the answer is right or wrong. Any suggestions???