loop_counter++; // increase loop counter by one.
}
printf("\nPress ENTER to quit");
getchar();
} // END void main(void)
How do I make it so that when the user inputs the number 2 the output would result to 10. Every time I activate it the output is always appear when I am running this program.
Hello and welcome to the forums! Please use the <> code button to the right of the text edit box when posting code.
What do you mean by "the output would result to 10"? I do not see if(user_input == '2') anywhere, so why do you expect that "the output would result to 10"?
Please clarify your question, so that we can better help you.
oh ok thanks for the tip and what I was trying to say was that how can I make the program to get an output of 10 when type in 2. Every time I run the program the output is already there BEFORE I typed in 2...
Line 2 calls FunctionUser() and line 7 asks for a character from the keyboard. If you want the program to output 10 after the user enters a character, you may want to move the FunctionUser stuff in the while loop beneath the user input stuff.