Get a Head Start with Promo Code: EarlyBirdSpring22
Every C++ program must contain a ____ function.
Already a member? Log In Here
Here’s a question found on myprogramming lab for C++:
Given an integer variable i and a floating-point variable f, write a statement that writes both of their values to standard output in the following format: i=value -of-i f=value -of-f
Thus, if i has the value 25 and f has the value 12.34, the output would be:
But if i has the value 187 and f has the value 24.06, the output would be:
Here’s my code:
using namespace std;
i = 25;
f = 12.34;
cout << "i=" << i <<"\n";
cout << "f=" << f;
And for some reason the my answer is wrong. Is there something I missed? Thanks
You must be logged in to post a comment.