0 like 0 dislike

Please fix the given code below:

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
	
	$1 sticks = 9;
	int taken;
	int Player = 1;
	
	$2(sticks > 0){
		printf("Player %d -- Sticks remaining: %d",Player, sticks);
		printf("\nHow many sticks do you want to take (1-3): ");
		scanf("$3",&taken);
		
		while(taken>3$4taken<1){
			printf("\nHow many sticks do you want to take (1-3): ");
			scanf("%d",&taken);
		}
		sticks -= taken;
		
		Player++;
		
		if(Player==3){
			Player = 1;
		}
		
	}
	
	
	printf("****THE WINNER IS: Player %d !!****", $5);

	return 0;
}

 

 

[Exercise] Fill in the blank - asked in Chapter 3: Branching, Looping and Functions by (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 87 views

17 Answers

0 like 0 dislike
Hidden content!
*

*
*
* **
80/100 answered by (192 points)
0 like 0 dislike
Hidden content!
**
* * *

%d
** ** *
100/100 answered by (281 points)
0 like 0 dislike
Hidden content!
*
** *
**
*
*** **
80/100 answered by (244 points)
0 0
while -> all small characters :)
0 like 0 dislike
Hidden content!

**
*

*
100/100 answered by (221 points)
0 like 0 dislike
Hidden content!

* *
*
*
*
100/100 answered by (220 points)
0 like 0 dislike
Hidden content!
*
**
*

** **
80/100 answered by (183 points)
0 like 0 dislike
Hidden content!
**
** *
**
*
* *
100/100 answered by (273 points)
0 like 0 dislike
Hidden content!
*
** *

%d
* * * *
* * *
80/100 answered by (269 points)
0 like 0 dislike
Hidden content!
*
*
*
**
**** *
100/100 answered by (153 points)
edited by
0 like 0 dislike
Hidden content!
**
* *
**

***
answered
edited by
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.79.71
©2016-2019

Related questions

0 like 0 dislike
18 answers
[Exercise] Multichoice - asked Dec 2, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 82 views
0 like 0 dislike
14 answers
[Exercise] Essay (Open question) - asked Nov 2, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 59 views
0 like 0 dislike
22 answers
[Exercise] Coding (C) - asked Dec 30, 2017 in Chapter 3: Branching, Looping and Functions by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 84 views
8,379 questions
65,747 answers
39,979 comments
1,515 users