answersLogoWhite

0

Write a program to s wap kth and k plus 1th element?

Updated: 8/18/2019
User Avatar

Wiki User

13y ago

Best Answer

Assuming the elements are integer type...

a[k] ^= a[k+1];

a[k+1] ^= a[k];

a[k] ^= a[k+1];

...but if they are not integer type...

temp = a[k];

a[k] = a[k+1];

a[k+1] = temp;

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to s wap kth and k plus 1th element?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write the subscript in c plus plus code using Balaguruswamy edition?

Subscripts have not changed since C++ evolved from C. Given an array x, the subscript x[n] returns a reference to the n-1th element of x. Note that Balaguruswamy is a book writer, he has not released any edition of C++.


How many yards are in 1Th of a mile?

One 1th of a mile = 1,760 yards.


What is 10 to the 1th power?

101 = 10


What scripture is like a thief in the night?

1 Thes. 5:2 and Rev. 3:3 both but usually refers to 1 Thes. 5:2 here is the whole context. (1Th 4:16 KJV) For the Lord himself shall descend from heaven with a shout, with the voice of the archangel, and with the trump of God: and the dead in Christ shall rise first: (1Th 4:17 KJV) Then we which are alive and remain shall be caught up together with them in the clouds, to meet the Lord in the air: and so shall we ever be with the Lord. (1Th 4:18 KJV) Wherefore comfort one another with these words. (1Th 5:1 KJV) But of the times and the seasons, brethren, ye have no need that I write unto you. (1Th 5:2 KJV) For yourselves know perfectly that the day of the Lord so cometh as a thief in the night. (1Th 5:3 KJV) For when they shall say, Peace and safety; then sudden destruction cometh upon them, as travail upon a woman with child; and they shall not escape. (1Th 5:4 KJV) But ye, brethren, are not in darkness, that that day should overtake you as a thief. (1Th 5:5 KJV) Ye are all the children of light, and the children of the day: we are not of the night, nor of darkness. (1Th 5:6 KJV) Therefore let us not sleep, as do others; but let us watch and be sober. (1Th 5:7 KJV) For they that sleep sleep in the night; and they that be drunken are drunken in the night. (1Th 5:8 KJV) But let us, who are of the day, be sober, putting on the breastplate of faith and love; and for an helmet, the hope of salvation. (1Th 5:9 KJV) For God hath not appointed us to wrath, but to obtain salvation by our Lord Jesus Christ,


When was Rocky Jones born in shake it up?

september 1th


How do you get the 1th badge in HeartGold?

beat falker with a senret lv100


When is the Doctor Who series 6 finale?

October 1th, 2011


When will the mcj entry test result come?

1th January


What is the 9th song on Chris Brown's 1th album?

What's My Name


What are the release dates for The 1th Annual Commitment to Life Awards - 1985 TV?

The 1th Annual Commitment to Life Awards - 1985 TV was released on: USA: 19 September 1985 (Los Angeles, California)


When is Anna university BE 1th sem result 2011?

febravery 20th 2011


Do you use 1th instead of 1st?

No, because the word is "first", not "firth" or "oneth".