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)

ADITI Other Question

Q. What is the memory allocated by the following definition ?

int (*x)[10];
6. In the program segment in question 5 what is the value of a at the end of the while loop?