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 to find type of variable?

919


How big is an int16?

840


Why does my windows application pop up a console window every time I run it?

922


Why singleton pattern is used in c#?

907


What is the use of ispostback in c#?

823


What is the full form of GAC? Explain its uses?

940


What are different types of classes in c#?

850


What are Uses of CLR

943


Which programming language is best for desktop applications?

879


Can you prevent a class from being instantiated?

957


What is windows forms in c#?

866


What are generations and how are they used by the garbage collector?

874


What is using keyword in C#?

979


What is the difference between package and interface?

874


What is the difference between Object and class adapters?

911