What is the incorrect action and why does it occur?

Specification: Fill a 100-element floating point array with the values 0.01, 0.02, ?, 0.99, 1.0.
```
#include
using namespace std;
int main()
{
float x[100];
int i;
for(i = 1; i <= 100;++i)
{
x[i] = i/100;


}
return 0;
}
```


```
#include
using namespace std;
int main()
{
float x[100];
int i;
for(i = 1; i <= 100;++i) << WHOOPS out of bounds at 100. use <100
{
x[i] = i/100; << x array filled w/ 0’s. integer division :-(
need to use i/100.0; or use cast
i/static_cast(100);
}
return 0;
}
```

Computer Science & Information Technology

You might also like to view...

In order to test for specific vulnerabilities, test ____________________ are run at the chosen points in the network.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Programs remember numbers and other data in the computer's memory and access that data through program elements called

a. comments. b. messages. c. integers. d. variables.

Computer Science & Information Technology

If the Single Step feature is on when a macro ends, it will automatically turn off

Indicate whether the statement is true or false

Computer Science & Information Technology

When you change a file that had been attached to a database through the attachment data type and then change that document, the changes will be reflected in the database

Indicate whether the statement is true or false

Computer Science & Information Technology