What is printed by the following code?
#include <iostream>
#include <math.h>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
double Num1, Num2;
cout << "Please enter two float number : ";
cin >> Num1 >> Num2;
double average = (Num1 + Num2)/2;
cout << "The average between these number is :m" <<average << endl;
cout << "The nearest integer around the average is : " << round(average)<<endl;
return 0;
The answer to your question is provided in the image:
Comments
Leave a comment