63 050
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #55812 in C++ for Dharvin

Question #55812
Write a functions named sqrIt() that computes the square of the value passed to it and displays the result. The function would be capable of squaring numbers with decimal points. Make sure your function is called from main().
Expert's answer
#include <iostream>
using namespace std;
int squareIT(int n);

int main(){
for(int i=1;i<10;i++)
{
cout<<"i= "<<i<<" "<<"i^2 = "<<squareIT(i)<<endl;
}
return 0;
}
int squareIT(int n){
return n*n;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions