Question

Question 5 10 pts Predict the output of the following C program: #include <stdio.h> void mainot double x[4] = (3.14, 1.62, 2.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
int main()
{
    double x[4] = {3.13,1.62,2.72,654.1};
      
    printf("%d\t%c\t%f",(int)(100**(x+1)),(int)x[3]/10,x[2]);
}

OUTPUT

162 A 2.720000

Explanation

(int)(100**(x+1)), will return 162. Because *(x+1) = 1.62. Then 100 * *(x+1) means 162. So it will print 162 because it will print the integer part only.

(int)x[3]/10 wll return A. bcause x[3] = 654.1/ x[3]/10 = 65.41. (int)x[3]/10 will return 65 only. Since we will print it in charcater form so ascii value of 65 is A.

x[2] will print 2.720000. because the float values prints 6 decimal places by default

in C.

Add a comment
Know the answer?
Add Answer to:
Question 5 10 pts Predict the output of the following C program: #include <stdio.h> void mainot...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT