Answer to Question #240166 in C++ for yasikhan

Question #240166

Write a program that will output the square root of any number entered through the keyboard, until the inputted number, is zero.                 


1
Expert's answer
2021-09-22T00:05:43-0400
#include<iostream>
using namespace std;
int main(){
	int x;
	do{
		
		cout<<"Enter a number\n";
		cin>>x;
		cout<<"The square of: "<<x<<"  is  "<<x*x<<endl;
	}while(x != 0);
}

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 the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS