- #1
number0
- 104
- 0
Hello,
I just started taking a computer science course involving the program language c. I was wondering if anyone know the command that enables the user to type in a numerical input into the program.
For example:
1. The user runs the program "Math Wizard."
2. The program displays the sentence in printf "What is 2 + 2 equal to?"
3. Then the user gets to type in the value (hopefully 4). <--- I am stuck here because I do not know the command in c that will enable the user to type in a numerical value (or characters) of some sort into the program.
Another example would be in c++. The command "cin" will get the user input. I am looking for a command that is exactly like "cin" but for c not c++.
Can anyone please help me? Thank you in advance.
I just started taking a computer science course involving the program language c. I was wondering if anyone know the command that enables the user to type in a numerical input into the program.
For example:
1. The user runs the program "Math Wizard."
2. The program displays the sentence in printf "What is 2 + 2 equal to?"
3. Then the user gets to type in the value (hopefully 4). <--- I am stuck here because I do not know the command in c that will enable the user to type in a numerical value (or characters) of some sort into the program.
Another example would be in c++. The command "cin" will get the user input. I am looking for a command that is exactly like "cin" but for c not c++.
Can anyone please help me? Thank you in advance.