Finding a number which was log of base 2
Answer / jaganathan gnanavelu
log of base 2 means given variable is power of 2. So
void main(){
int x;
if(x&(x-1){
printf("Given Number is not log base 2\n");
}
}
| Is This Answer Correct ? | 5 Yes | 2 No |
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
How to swap two variables, without using third variable ?
104 Answers AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
Cluster head selection in Wireless Sensor Network using C programming language.
print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
35 Answers Tata Elxsi, TCS, VI eTrans,
write a program for area of circumference of shapes
WAP to display 1,2,3,4,5........N
how to delete an element in an array
How to read a directory in a C program?
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }