CoolInterview.com - World's Largest Collection of Interview Questions
Interview Success Kit - 9,000 Interview Que. & Ans.
Covers 9,000+ Interview Questions asked in actual MNC Interviews - all with model answers.
Start Your Own website Now
Sponsored Links

Interview Questions
Our Services


INTERVIEW QUESTIONS C ARRAYS IN C DETAILS
Question :
How can you sort the elements of the array in descending order?
Category Arrays in C Interview Questions
Rating (0.3) By 19 users
Added on 10/24/2004
Views 2557
Rate it!
Answers:

By calling Sort() and then Reverse() methods.



By calling Sort() and then Reverse() methods



Posted by: srihariraju    

Contact srihariraju Contact srihariraju

#include<stdio.h>
main()
{
int a[10],sum=0;
int i,j,temp;
printf("enter the arraya");
for(i=0;i<10;i++)
{
scanf("%d",&a[i]);
//sum=sum+a[i];
}
for(i=10;i>=0;i--)
{
for(j=0;j<10;j++)
{
if(a[i]==a[j])
printf("%d ",a[j]);
}
}
}



Posted by: Byka.swapna    

Contact Byka.swapna Contact Byka.swapna

If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification  Enter the above shown code:*
    Inform me about updated answers to this question

       
    Related Questions
    View Answer
    Array is an lvalue or not?
    View Answer
    Can the size of an array be declared at runtime?
    View Answer
    Can the sizeof operator be used to tell the size of an array passed to a function?
    View Answer
    Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?
    View Answer
    When does the compiler not implicitly generate the address of the first element of an array?
    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Arrays in C Interview Questions

    User Options
    Sponsored Links


    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0 Seconds