12,701,828 members (34,600 online)
Rate this:
Please Sign up or sign in to vote.
See more:
in console application.
Thanks in advance

Regard
Sham
Posted 8-Nov-12 6:58am
Updated 8-Nov-12 9:21am
v2
Comments
shambhoo kumar 8-Nov-12 11:59am

any one help me.it's very urgent......plz
joshrduncan2012 8-Nov-12 12:05pm

Why do you not want to use the sqrt function?
shambhoo kumar 8-Nov-12 12:12pm

because just i want to check ur programming skill....ok..:(
it's my interview question and i do not know how i solve it so i ask to every one..:)
Andreas Gieriet 8-Nov-12 12:38pm

What is your background? What math do you know, e.g. logarithms? What algorithms do you know, e.g. binary search? What computer arithmetics do you know, e.g. CORDIC?
Plenty of areas to check out... :-)
Cheers
Andi
aspnet_regiis -i 8-Nov-12 12:40pm

This is not the place to get your homework done

## 3 solutions

Rate this:
Please Sign up or sign in to vote.

## Solution 1

There are a number of ways to do it, and Google will help you find the algorithms.

But we do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. So, I won't be pointing you at them.

Try it yourself, you may find it is not as difficult as you think!
Comments
Andreas Gieriet 8-Nov-12 12:26pm

My 5!
I wonder how difficult it is to Google, e.g. Wikipedia...
Cheers
Andi
Rate this:
Please Sign up or sign in to vote.

## Solution 4

This looks like a test of thinking about a problem more than coding it.
The OP question appears to be: Is a given number R the square root of another given number X.
Taking the square root of X is "forbidden".
[Hint]
...but multiplication, and checking for equality (within a tolerance) is allowed.
[/Hint]
v2
Rate this:
Please Sign up or sign in to vote.

## Solution 5

#include<stdio.h>
main()
{

int a,b,c,d;
printf("Enter:");
scanf("%d",&b);
for(a=1;a<=b;a++)
{
if((a*a)==b)
{c=2;break;}

}
if(c==2)
printf("Yes");
else
printf("No");

printf("\n");

}
Comments
Shambhoo kumar 10-Feb-13 6:13am

Thanks dear..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Top Experts
Last 24hrsThis month
 OriginalGriff 248 Peter Leow 173 ppolymorphe 100 BillWoodruff 70 John Simmons / outlaw programmer 60
 OriginalGriff 4,146 Peter Leow 2,436 ppolymorphe 1,972 Mika Wendelius 1,813 Jochen Arndt 1,479

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 1 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100