GeekInterview.com
Series: Subject: Topic:
Question: 249 of 587

1.write a function swap(a,b) which interchanges 2 integers .call the function from the sort() funt whenever two integers have to be interchanged.

2. write a c program to add the diagonal elements of an 3x3 array.

3.write a function called max(a,b,c) that finds the bigger of 2 nos a and b and stores it in the address of the int variable passed as the third argument.

Asked by: Interview Candidate | Asked on: Feb 17th, 2007
Showing Answers 1 - 1 of 1 Answers
Geek

Answered On : Feb 22nd, 2007

void swap(int *a, int *b) {
    int temp = *a;
    *a = *b;
    *b = temp;
}

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.