ADITI
Company
Programming
Program
Q. In the following program segment
#include
main()
{
int a=2;
int b=9;
int c=1;
while(b)
{
if(odd(b))
c=c*a;
a=a*a;
b=b/2;
}
printf("%dn",c);
}
How many times is c=c*a calculated?
Read Solution (Total 3)
-
- 4 times........
- 11 years agoHelpfull: Yes(0) No(0)
- 2 is the answer
- 10 years agoHelpfull: Yes(0) No(0)
- how odd(b) i.e. odd(9) works?
I know loop.
But odd(9) stands for? - 10 years agoHelpfull: Yes(0) No(0)
ADITI Other Question