Advertisement

12.25.2002 at 09:06PM PST, ID: 20436319
[x]
Attachment Details

how to write swap(int i,int j) in c

Asked by rpatna in C Programming Language

Hi,
 here is the problem in 'c' which was asked in an interview


main()
{
  int i = 4;
  int j = 5;
  swap(1,j);
  printf(" %d  %d " , i,j)
}

its output is 4 5
but I want  5 4  without changing above four lines.

so, write swap function in 'c' to get output 5 4

Start Free Trial
 
Keywords: how to write swap(int i,int j) in c
 
Loading Advertisement...
 
[+][-]12.25.2002 at 10:13PM PST, ID: 7632145

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.25.2002 at 11:06PM PST, ID: 7632182

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 01:55AM PST, ID: 7632288

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 02:22AM PST, ID: 7632306

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 04:14AM PST, ID: 7632381

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 04:20AM PST, ID: 7632385

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 07:14AM PST, ID: 7632587

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Sign Up Now!
Solution Provided By: stsanz
Participating Experts: 4
Solution Grade: A
 
 
[+][-]12.26.2002 at 04:03PM PST, ID: 7633964

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 11:37PM PST, ID: 7634897

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.26.2002 at 11:57PM PST, ID: 7634948

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.28.2002 at 02:38AM PST, ID: 7638962

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.29.2002 at 06:57PM PST, ID: 7643904

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32