ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
How to convert a binary number to Hexa decimal number??
(Note:Do not convert it into binary and to Hexadecimal)
 Question Submitted By :: Bharath Subash.d
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)
Answer
# 1
let us take a binary number.. say :

       0000000110101110  (16 bit number)
we already know it's the consersion to HEXA DECIMAL equivalent.... so split the numbers into 4 bits each... like,

      0000 0001 1010 1110 (16 bit number)

and for converting directly there is a conversion called 8421 code...

     8421 | 8421 | 8421 | 8421
     0000 | 0001 | 1010 | 1110

now in the first pass it is zero (from left to right) , second it is 1 , in third it is 10 (A in hexa.) , in fourth it is 14 (E in hexa.)


thus the final representation for the above binary is : 1AE


thank u
 
Is This Answer Correct ?    2 Yes 1 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
write a program for size of a data type without using sizeof() operator?  7
What ios diff. Between %e & %f? Honeywell1
Is main() function predfined or userdefined?  7
if a five digit number is input through the keyboard, write a program to calculate the sum of its digits. (hint:-use the modulus operator.'%')  9
Can u return two values using return keyword? If yes, how? If no, why?  7
what are the interview question's in the language c Nipuna1
52.write a “Hello World” program in “c” without using a semicolon? 53.Give a method to count the number of ones in a 32 bit number? 54.write a program that print itself even if the source file is deleted? 55.Given an unsigned integer, find if the number is power of 2?  6
Write a program which take a integer from user and tell whether the given variable is squar of some number or not. eg: is this number is 1,4,9,16... or not Alcatel8
what is the difference between normal variables and pointer variables.............. Satyam7
How to swap two values using a single variable ? condition: Not to use Array and Pointer ?  4
f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p? Hughes4
what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; } Honeywell2
what is the differance between pass by reference and pass by value. Infosys4
HOW CAN ADD OUR FUNCTION IN LIBRARY.  5
how the size of an integer is decided? - is it based on processor or compiler or OS? nvidia16
Why preprocessor should come before source code?  2
Give a fast way to multiply a number by 7 Microsoft8
what is data structure  4
const char * char * const What is the differnce between the above tow?. TCS5
f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=? Geometric-Software2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com