C
Programming and Technical
write a function Power2 which returns the nearest power of 2 of the number being passed.
Read Solution (Total 2)
-
- int Power2(int n)
{
return(n*n);
} - 11 years agoHelpfull: Yes(1) No(0)
- //suppose n=3,then 3^2 means 3+3+3,ifn=4then 4^2=4+4+4+4..this way
int power2(int n)
{
int i,sum=0;
for(i=0;i - 11 years agoHelpfull: Yes(0) No(6)
C Other Question