how to swap all the values without using temporary variable.
tha values r a = 20, x=60 and p=2.
Answer Posted / padmas
To swap the values without using temporary variable
for a,x and p,
Do a call to swap function for a and p and
another call to same swap function for x and p.
call1:swap(a,p);
call2:swap(x,p);
swap(variable1,variable2)
{no temporary variable}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the difference between COM and CORBA?
One boy has to climb steps. He can climb 1 or 2 steps at a time. Write a function that will returns number of way a boy can climb the steps. Int WaytoSteps(int n) (eg:- suppose number of steps is n=4 ,the function will return 5 (one-one-one-one ,one-one-two, one-two-one-,two-one-one, two-two)
hi i am jyoti i have done sap training in sd and master degree in economics have 2 year exp as enduser in (gdms)and 1 year as sd consultant.as contract basis now what i can do for getting job in it industry
write algo for cobol program whichuse three flat file to extract some specific information 8 marks mainframe
Display names and numbers of employees who have 5 years or more experience and salary less than Rs.15000 using array of structures (name, number, experience and salary)
Write a shell program. Enter number of days from keyboard. Find out the number of years, month and days it contains
What binary value will be internally stored for NULL for the type S9(1) COMP 3 in mainframe
1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?
what is client server & server? What r types of Joins? explsin it! which types of indexex in sql server? what is triggers?
As per interoperatbility programs written in one language can be used by other language. How can we restrict the features of one language (say C#) in the programmer written in another language (say VB)..for example we have some features like operator overloading which is possible C#.NET (not in VB.NET), how can we restrict that when we are using this code in VB.NET.
how to study PHP my own? i reffered many sites.. but as being a fresher i couldnt follow those... which site will be the best one?
How can recruiter justified that the candidate is expert in Algorithm and datastructure for Software product development ?
will it allow to add same value in HashMap class.
3. What is the difference between testing and Quality Assurance?
How will you prove that java swing is multithreaded?