There are three compiler warnings with this code. Can you spot them?

```
int main()
{
float a = 4.0, b = 8.0, c = 1.5;
int x = 5, y = 7.5, z = 19.0;
float q, r;
int s, t;
s = x + z/y*c;
t = b/a * b*x + c;
q = y * a+a * c;
r = z % x+b/a;
```


```

int main()

{

float a = 4.0, b = 8.0, c = 1.5; //warnings here

int x = 5, y = 7.5, z = 19.0; //warnings here

float q, r;

int s, t;

s = x + z/y*c;

t = b/a * b*x + c;

q = y * a+a * c;

r = z % x+b/a;

```



```

s = x + z/y*c;

/* s = 5 + 19/7*1.5

= 5 + 2 * 1.5

= 5 + 3.0

= 8.0 */



t = b/a * b*x + c;

/* t = 8.000000/4.00000 * 8.000000 * 5 + 1.500000

= 2.000000 * 8.000000 * 5 + 1.500000

= 16.000000 * 5 + 1.500000

= 80.000000 + 1.500000

= 81.5000000 (remember t is an int) */





q = y * a+a * c;

/* q = 7 * 4.000000 + 4.00000 * 1.50000

= 28.00000 + 4.00000 * 1.500000

= 28.00000 + 6.00000

= 34.00000 */



r = z % x+b/a;

/* r = 19 % 5 + 8.00000/4.00000

= 4 + 8.00000/4.00000

= 4 + 2.00000

= 6.00000 */<

Computer Science & Information Technology

You might also like to view...

A serialized object is ________.

a. an object represented by XML that includes the object’s data. b. an object in memory that has been recreated from data in a file c. a standard output stream object used to convert objects in code to data in a file d. None of the above.

Computer Science & Information Technology

What will be output from the following code:

Computer Science & Information Technology

________ is used to analyze large amounts of data and identify unseen patterns or trends

Fill in the blank(s) with correct word

Computer Science & Information Technology

In the accompanying figure of a Microsoft Word 2016 document, Box A points to the _____ box.? ?

A. ?Compare document B. ?Search document C. ?Merge document D. ?Format document

Computer Science & Information Technology