HITEQUEST
technical interview Q & A for high-tech professionals
 
 
Interview Questions
Electronics Hardware
Computer Software
Intel screening questions
QA Software
Quick Thinking Tests
General questions
Phone screening questions
Submit your Q or A

Resources
Technical articles
Ask an Expert
How to get a job in Silicon Valley
Useful tips

Break point
Written Exam
Logic Tests
Professional Test
Tomato company
Cup of coffee
How stock market works
Engineering jokes

About Hitequest
About Hitequest
Home page

 
 
 
 
 
 

 
=Computer Software Questions=

   
   

Q:There are two integers a and b. How to exchange the contents of them without using a third one?

A1: submitted by Anonimous1

The answer is to do the following:

int a = 7, b = 4;
b = a * b; // b = 28
a = b/a;   // a = 4
b = b/a;   // b = 7

A2: submitted by jhudzik

This will work:

  a = a + b
  b = a - b
  a = a - b