This buggy code wants to create an integer array of size 10, whose values are the integers from 1 to 10. Fix it! Answer: (penalty regime: 10, 20, ... %) Reset answer 1 int a[10]; 2 int i; 3 4- for (i=1; i<-10; i++) { - a[i] = i; }

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter6: Using Arrays
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question
This buggy code wants to create an integer array of size 10, whose values are the integers from 1 to 10. Fix it!
Answer: (penalty regime: 10, 20, ... %)
Reset answer
1234569
4▾
int a[10];
int i;
for (i=1; i<=10; i++) {
a[i] = i;
}
Transcribed Image Text:This buggy code wants to create an integer array of size 10, whose values are the integers from 1 to 10. Fix it! Answer: (penalty regime: 10, 20, ... %) Reset answer 1234569 4▾ int a[10]; int i; for (i=1; i<=10; i++) { a[i] = i; }
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,