Question: Code in C: I'm trying to write the code for the beginning of a pick up sticks for an assignment. I want the user to

Code in C:

I'm trying to write the code for the beginning of a pick up sticks for an assignment. I want the user to enter at least 10 sticks. I'm having trouble writing code which doesn't accept anything that isn't a number. If the user enters either a character or something like " 3" or "00001", I want the program to continue to ask for them to enter a valid number.

I tried using scanf but that allows for entries I don't the program to accept. I'm trying to use sscanf but can't seem to get that to work either.

Here's the code I have so far:

Code in C: I'm trying to write the code for the beginning

#include #include int userTurn1(int argc, char **argv) int main() int a a = userTurn1(a); printf( return 0 %2 ", int userTurn1(int argc, char **argv) int stickNum printf sscanf("%d", &st ickNum); ("Hello, welcome to Pick Up Sticks. InHow many sticks would you while(stickNum

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!