square of a number without using * operator

Status
Not open for further replies.

alangs

Member level 3
Joined
Feb 5, 2010
Messages
57
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
india
Activity points
1,681
can anybody tell me how i can calculate the square of a number without using * operator.plz give me the answer in c language by using for loop......
 

You can calculate Exp(Log(x)+Log(x))
 

Adding the first N odd numbers is equal to calculate N^2.

1 = 1^2
1 + 3 = 2^2
1 + 3 + 5 = 3^2
1 + 3 + 5 + 7 = 4^2

and so on...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…