# www.vustudents.ning.com

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Dear Friends and VU students this thread discussion, I have created for weekly lecture from now to Friday. We all discuss the problems of C++ (Introduction to Programming) from Lecture 20 to 25.

Remember when you are asking some question please also mansion the lecture number.

So, I request to all participate in this discussion.

As you know that 20th July, 2013, Our Final Exam will be started.

So, We have very short time...

I hope you all understand.

Regards

Ali Raza Marchal

BSCS[Hons] 2nd Semester

Views: 941

### Replies to This Discussion

Final Term  exams will start on 20 July . So Please Focus on Lectures and Participate in Lecture Wise Discussions and Assignments , GDB, Quiz Discussions and Clear ur concepts Thanks  and Regards.

Mr Al Raza Marchal U take start 1st by puttin up any question then we'll knew hw we proceed!!!

bit manipulation, the number is written in hexadecimal form.we put 0x or 0X before the number to write a number in hexadecimal...

The Exclusive OR operator ( ^ ) can be used to encrypt and decrypt the password.

Attachments:

Raid abbr is redundant array of independent disks way of storing data in different and multiple hard disk...

in handouts its Inexpensive

bt which i'd read b4 was independent*

redundant array of inexpensive devices both are same independent i think old name.... but not 100% sure

WHAT IS SWAPPING?

Swap means to exchange. Therefore in C/C++ swapping of variables simply means exchanging the value of one variable with another variable.

HOW TO SWAP_ Four Method of Swapping

METHOD 1:

USING THREE VARIABLES

METHOD 2:

USING TWO VARIABLES AND ADDITION/SUBTRACTION OPERATION

METHOD 3:

USING TWO VARIABLES AND MULTIPLICATION/DIVISION OPERATION

METHOD 4:

USING TWO VARIABLES AND XOR OPERATION

USING TWO VARIABLES AND XOR OPERATION

This method may appear quite complicated to you. But if you have some knowledge of XOR (binary operation) then you will find that it is very simple. If you do not have any idea about XOR operation then I will recommend you to refer a book on C or C++ programming and read about bitwise operators in it or search in google. You can also read about Boolean Algebra.

Let a there are three variables A, B, and C. If C stores the XOR of A and B

i.e. C=A XOR B then

if you XOR A to C you will get B and,

if you XOR B to C you will get A.

See how…

If  C = A XOR B  then

C XOR A = (A XOR B) XOR A = B  or simply C XOR A = B

And, C XOR B = (A XOR B) XOR B = A or simply C XOR B = A

Let us understand it using numeric values

If A=5, B=10 therefore C=A XOR B = 15  (use windows calculator to calculate)

then C XOR A = 15 XOR 5 = 10   (use windows calculator to calculate)

and C XOR B = 15 XOR 10 = 5