Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Finding a number which was log of base 2

Finding a number which was log of base 2..

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

More C Code Interview Questions

main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }

#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

Printf can be implemented by using __________ list.

void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }

Finding a number multiplication of 8 with out using arithmetic operator

main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }

#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }

Implement a t9 mobile dictionary. (Give code with explanation )

What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql