AD1

Monday, 13 March 2017

Reverse bits of Byte

write a C function to reverse the bits of a Byte as example if we have variable unsigned char x=0x07=0b00000111 as input parameter after reversing its bits it would return 11100000

solution 


Tuesday, 7 March 2017

Palindrome String

Write a C code to check a String is palindrome or not , Some palindrome strings examples are "a", dad", "radar", "madam", "abcba" etc.

solution



Monday, 6 March 2017

From decimal to binary

Write a C program to convert an integer from decimal to binary , using logical bitwise operators

solution



Thursday, 2 March 2017

what is the output

what is the output of this C code 
output:
66    B
4
Explanation:
union temp t={66,'A'};
this statement will initialize only the first member of the union x with 66 and the compiler will ignore the second value 'A', as one element is sufficient to initialize all union members as they share the same memory locations
sizeof(t) =4 size of largest element in memory location



Wednesday, 1 March 2017

what is the output of this C code

output :
compilation error in line 19 , as you can not assign two structures of different types
also there is a compilation error in line 21 as rational operators can not be applied on structures