If you are viewing my post, thank you for taking the time to hep me out. It is greatly appreciated. Here is what I'm trying to do:
Write a function called Square2 that will take as arguments an integer and a double. With the use of references i want my function to return the square of both values. When the Square2 function returns I want it to print out the square of both values. I am stuck, becasue I compile the code but there are no errors.. what am i doing wrong?? Any helpful direction is greatly appreciated. Heres the code I have so far:
#include <iostream>
using namespace std;
void getInts(int &a, double &b);
void square2(int &a, double &b);
int main()
{
int x;
double y;
getInts(x,y);
cout<< x << " squared and " <<y<< " squared is " <<endl;
square2(x,y);
cout<< x << " " <<y<< endl;
return 0;
}
void getInts(int &a, double &b)
//getting user supplied input
{
cout << "Please enter a whole number and a decimal number " << endl;
cin >> a >> b;
}
void square2(int &a, double &b)
//square the user supplied numbers and put out at main
{
int c;
double d;
c=a*a;
d=b*b;
}