Input an array and then print the repeating characters??
Example:
Input:1,3,23,11,44,3,23,2,3.
Output:3,23
plz help me.... i want a code of it. In C language.
Answer Posted / ankit dhanna
#include<iostream.h>
#include<conio.h>
void main()
{
int a[8],i,j,k,temp[8];
k=0;
cout<<"enter 8 elements "<<endl;
for(i=0;i<8;i++)
{
cin>>a[i];
}
for(i=0;i<8;i++)
{
for(j=0;j<8;j++)
{
if((a[i]==a[j])&&(i!=j))
{
temp[k]=a[i];
k++;
}
}
}
for(i=0;i<k/2;i++)
{
cout<<"repeated element "<<temp[i];
}
getch();
}
| Is This Answer Correct ? | 16 Yes | 15 No |
Post New Answer View All Answers
There are 600 tennis players 4% wear wrist band on one wrist Of the remaining, 25% wear wrist bands on both hands How many players don't wear a wrist band?
The difference b/w the compound interest payble half yearly and the simple interest on a certain sum lent out at 10% p.a for 1 year is Rs 25. What is the sum?
In a helpful book on the indexing and searching of text-based electronic files, a well-respected computer scientist differentiated _____________________ search efficiently using augmented inverted indices. latent semantic indexing, which is a technique designed to analyze relationships among the words within documents, with vector space models, which can between latent semantic indexing, which is a technique designed to analyze relationships among the words within documents, and vector space models, which can between latent semantic indexing, which is a technique designed to analyze the relationships among words within documents, with vector space models, which can latent semantic indexing, which is a technique designed to analyze the relationships among words within documents, and vector space models, which can
One clock rings 7 O'clock in 7 sec.In how many seconds it will ring 10 O'clock.
There are coins of Rs.5, 2, 1,50p, 25p, 10p, 5p. each one has got a weight. Rs 5 coin weighs 20gms.find the minimum number of coins to get a total of 196.5gms.
If "PROMPT" is coded as QSPLOS ,then "PLAYER" should be?
How many rational numbers are there between 0 & 5?
If P=Total number of components, Q = number of defective components .What is the % of non defective components?
I was married 10 years before my wife was sixth member of my family and now I have a baby and today father died and the average age of my family was same as it was 10 years before. Find my father's age when I was married?
The diameter of a circle is 21 metres. It will take how many revolutions to cover a distance of 6.6 km?
Mr. Sohan works for Azania Company. The company grants 1000 shares to Mr. Sohan in 2008. At that point each share is worth Rs. 100. In 2010, he decides to sell his entire stake and at that point, the value is Rs. 120 per share. The government declares that the tax to be paid is 10% of the entire profit. Due to the inflation, the value of a rupee in 2010 is equivalent to 0.8 of a rupee in 2008. In this situation, which of the following model indicates the actual tax to be paid by the investor?
‘a‘ number of persons work daily ‘b’ hours to produce ‘c’ items. If ‘d’ persons walks away from the group what will be the number of hours to produce ‘c’ items. ?
in a market 4 man are standing .the average age of the four before 4 years is 45, after some days one man is added and his age is 49. What is the average age of all?
A bike runs at the speed of 50 km/h when not serviced and runs at 60 km/h when serviced. After servicing the bike covers a certain distance in 6 h. How much time will the car take to cover the same direction?
Ramesh working alone on a job takes 12 days more than what he would have taken if Suresh had worked along with him while Suresh working alone on the same job takes 27 days more than what he would have taken if Ramesh had worked along with him. Find the time that both of them would take together to do the job.