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 |
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
can u give me the c codings for converting a string into the hexa decimal form......
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,
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
Write a program that reads a dynamic array of 40 integers and displays only even integers
Print an integer using only putchar. Try doing it without using extra storage.
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
which function is used to clear the buffer stream on gcc? for example: I wrote following code on gcc #include<stdio.h> int main(void) { char ch; int a,b; printf("\nenter two numbers:\t"); scanf("%d%d",&a,&b); printf("enter number is %d and %d",a,b); printf("\nentercharacter:\t"); scanf("%c",&ch); printf("enter character is %c",ch); return 0; } in above progarm ch could not be scan. why?plz tell me solution.
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"