0 like 0 dislike
510 views

 Please fix the code given, to be executed and will show the output below

Code

#include <stdio.h>
int main(){

	int x[$1], i;
	
	for(i=0;i<10;$2){
		$3 = i+1;
		printf("The index [%d] has a value of: %d\n", $4, x[i]);
	}
	
	return 0;
}

 

Output

The index x[0] has a value of: 1
The index x[1] has a value of: 2
The index x[2] has a value of: 3
The index x[3] has a value of: 4
The index x[4] has a value of: 5
The index x[5] has a value of: 6
The index x[6] has a value of: 7
The index x[7] has a value of: 8
The index x[8] has a value of: 9
The index x[9] has a value of: 10

 

 

[Exercise] Fill in the blank - asked in Chapter 4: Arrays by (5.9k points)
ID: 35798 - Available when: Unlimited - Due to: Unlimited
| 510 views

18 Answers

0 like 0 dislike
Hidden content!
*

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



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

**
*
100/100 answered
0 like 0 dislike
Hidden content!

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

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

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

*
**
100/100 answered by (254 points)
0 like 0 dislike
Hidden content!
**
*
*
100/100 answered by (283 points)
0 like 0 dislike
Hidden content!
**
****
** *
*
100/100 answered by (183 points)
0 like 0 dislike
Hidden content!
*
*
*
100/100 answered by (268 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.126.108
©2016-2024

Related questions

0 like 0 dislike
20 answers
[Exercise] Fill in the blank - asked Dec 15, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
ID: 37578 - Available when: Unlimited - Due to: Unlimited
| 582 views
0 like 0 dislike
18 answers
[Exercise] Coding (C) - asked Jan 5, 2018 in Chapter 4: Arrays by nat236919 (5.9k points)
ID: 41054 - Available when: Unlimited - Due to: Unlimited
| 1.2k views
0 like 0 dislike
46 answers
[Exercise] Coding (C) - asked Dec 15, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
ID: 37580 - Available when: Unlimited - Due to: Unlimited
| 1.7k views
0 like 0 dislike
17 answers
[Exercise] Coding (C) - asked Dec 7, 2017 in Chapter 4: Arrays by nat236919 (5.9k points)
ID: 35804 - Available when: Unlimited - Due to: Unlimited
| 780 views
0 like 0 dislike
0 answers
[Resource] asked Jan 5, 2018 in Chapter 4: Arrays by nat236919 (5.9k points)
ID: 41053 - Available when: Unlimited - Due to: Unlimited
| 13 views
12,783 questions
183,443 answers
172,219 comments
4,824 users