Reverse the bit order in a single macro.
eg. i/p = 10010101 --> o/p = 10101001
Answers were Sorted based on User's Feedback
Answer / balaji ganesh
#include<stdio.h>
#define f(a) strrev(a)
main()
{
char c[20];
scanf("%s",c,printf("enter bit string;"));
printf("%s",f(c));
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vishnu
with out using strrev
=======================
#include<stdio.h>
#include<conio.h>
int i ;
void binary(int retval[],int num)
{
int k;
while(num >1)
{
k = num;
num =num/2;
retval[i] = k%2;
i++;
}
retval[i] =1;
}
int main()
{
int num;
int bin[20];
scanf("%d",&num);
binary(bin,num);
for(num=i;num >=0;num--)
printf("%d",bin[num]);
printf("\n");
for(num =0;num<=i;num++)
printf("%d",bin[num]);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
A program to write a number of letters and numbers, such as counting and display
Derive the complexity expression for AVL tree?
What does & mean in scanf?
#include<stdio.h> int main() { int i=0,j=1,k=2,m,n=0; m=i++&&j++&&k++||n++; printf("%d,%d,%d,%d,%d",i,j,k,m,n); }
12 Answers Capital IQ, Sasken,
What are disadvantages of C language.
Calculate 1*2*3*____*n using recursive function??
what is the disadvantage of using macros?
what are the static variables
8 Answers HCL, iFlex, TCS, Wipro,
In C programming, how do you insert quote characters (‘ and “) into the output screen?
How can you return multiple values from a function?
Write a program to print distinct words in an input along with their count in input in decreasing order of their count
How can I access a memory located at certain address?