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


Please Help Members By Posting Answers For Below Questions

A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay?

819


A team P of 20 engineers can complete a task in 32 days. Another team Q of 16 engineers can complete the same task in 30 days. Then the ratio of working capacity of 1 member of P to that of a member of Q is:

1062


Starting from point A, Jayant walked 15m towards west. He turned left and walked 20 m. He then turned left and walked 15m. After this he turned right and walked 12m. in which direction is Jayant from X and how far has he walked from point X?

860


Find the next series: AE BH CM DU?

858


Find the correct meaning of the following phrase: Penny wise pound foolish

753






C1,C2 upto Cn are n cities in a country.There are some roads connecting these cities.They are connected in such a that Crth city has r distinct routes connecting each of the other city in the country. 1)if n=27,then how many roads are there in a country? 2)if n=4,in how many distinct routes,can a person travel from c3 to c2?

2450


2. Masi specialises __ plesent ,well balanced wines into, about ,in, with 3. By the time I arrived __ the pub she all ready left in, on , at, into 4. erbiage the act of doing something the use many words witout nessecity a vegitable non of the above

6192


if f(x)=1/x then f(f(f(x))) equals

828


Perimeter of the back whell = 9 feet, front wheel = 7 feet on a certain distance the front wheel gets 10 revolutions more than back wheel . what is the distance?

862


194 base 10 = ____ base 5

858


A building with height D shadow upto G. What is the height of a neighbouring building with a shadow of C

673


what is diff b//w the singly reinforced beam,doubly reinforced beam?

1350


Two trains are travelling at equilateral .Train A is travelling in the direction of earths spin.Other train B is travelling in opposite direction of earths spin.Which trains wheels will wear first?and why?

1995


Which is the largest prime number that can be stored in a 9-bit register?

735


An article sold at a profit of 20% if both the c.p & s.p were to be Rs.20/- the profit would be 10% more. What is the c.p of that article?

687