Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

f i give input like 1,1,4,5,6,1,2,5,4,1,2, then output
should be like : 1-4, 2-2, 4-2, 5-1, 6-1 which means 1
occurs 4 times, 2 occurs 2 times like so.

Answer Posted / kirubasankar

#include<iostream.h>
#include<conio.h>
void main()
{
int i,j;
int a[20],t;
clrscr();
for(i=0;i<5;i++)
{
cin>>a[i];
}
for(i=0;i<5;i++)
{
for(j=i+1;j<=5;j++)
{
if(a[i]>a[j])
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
cout<<a[i];
}

getch();
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you escape in c#?

916


Which of the following API is used to hide a window?

1009


Why is it efficient to use System.string under System.Text.StringBuilder ?

967


What is .net console?

968


From which base class do all Web Forms inherit from?

967


What is c sharp language?

921


What are the 4 pillars of any object oriented programming language?

864


What is boxing? Explain its functionality?

950


What is dictionary collection in c#?

893


Can you have an array of arrays?

941


What is reflection c#?

866


What is Wrapper class in dot net?

1047


How do I edit a dll file?

868


Expalin the way you implement inheritance by using VB.NET/C#?

949


What is the relation between classes and objects?

932