
LANGUAGE: C++
CHALLENGE:
Every C++ program must contain a ____ function.
SOLUTION:
main
Every C++ program must contain a ____ function.
main
Have you heard the news? Matthew Maennche is hosting his Social Media 101 seminar tomorrow! We sure hope you can jo… https://t.co/UJmBN2tMp3 Tweet URL
By simply having access to someone who actually understands how digital marketing works, businesses can leverage th… https://t.co/HTF7wcsowP Tweet URL
Maennche Virtual CMO is a family owned and operated entity. After spending years in the trenches developing busines… https://t.co/t0oedhI7B9 Tweet URL
Matthew Maennche, of myVCMO, will help you cover tactics to make you market your small business even on a shoestrin… https://t.co/n5oVXMYbYn Tweet URL
If you couldn't make it yesterday afternoon you missed a great class! If you made it or not, I sure hope to see you… https://t.co/xp7hDlo5hZ Tweet URL
Hello Matthew,
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:
i=25 f=12.34
But if i has the value 187 and f has the value 24.06, the output would be:
i=187 f=24.06
Here’s my code:
#include
#include
using namespace std;
int main()
{
int i;
float f;
i = 25;
f = 12.34;
cout << "i=" << i <<"\n";
cout << "f=" << f;
return 0;
}
And for some reason the my answer is wrong. Is there something I missed? Thanks