[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Interview Questions and Answers :: Cisco

4. Write a Program to swap the 2 nibbles of a byte size variable.

Answer:

assuming 2 numbers are



a = 10



b = 20



 # 1. Summing up two numbers and store in 'a'



a = a b 



# 2. swap b by subtracting b value from above a value



b = a - b  # b = 30 - 20  = 10



# 3. get a value swapped 



a = a - b # a = 30 - 10 = 20



 

Post Your Answer Here:      Public      Private

Rate This: +0 -0
Report     

Post Your Reply Here:     

Report Error

Report Error

Please Login First Click Here