Answer to Question #36497 in C++ for Gs

Question #36497
Can anyone tell me the error and its correction

#include<iostream.h>
#include<conio.h>

int sqr(int num , int div);
int main()
{
int num;
cout<<"enter ";
cin>>num;
int div = num;
int sqrt;
sqrt=sqr(num,div) ;
cout<<sqrt<<endl;
return 0;
}


if(div==1)
{
return 1;
}

else
{
if((num/(div*div))%1!=0)
{
div=sqr(num,div-1);
}

if((num/(div*div))%1==0)
{
return div;
}
}
1
Expert's answer
2013-11-01T06:05:04-0400
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-36497.pdf

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

Ask Your question

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS