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
Find sqrt of 113 up to 3 decimal places.
A train 100 meter long takes 3 second to cross a man walking at the rate of 6km/hr in a direction opposite to that of the train. Find the speed of the train.
A question on "set" theory.it was given that less than 30 persons in class.
pls send me andhra bank clerk model papers&syllabus
solution of system of equations y-z=0,x+8y=4,3x+4y=7z is
Four persons can cross a bridge in 3, 7, 13, 17 minutes. Only two can cross at a time. Find the minimum time taken by the four to cross the bridge.
How long will a train 100m long travelling at 72kmph take to overtake another train 200m long travelling at 54kmph
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?
In a arithmetic reason 10,9,60,90,70 and 66.. .whats the next number with conclusion
The minute hand of a clock overtakes the hour hand at intervals of 64 minutes of correct time. How much a day does the clock gain or lose?
+ means * and * means / and / means % what is the value of these question 2+3*5/7 it was two question of these type.
Next number in the series 1, 1/2, 1/4, 1/8 ?
In a lock of 4 rings there r five characters how many unsuccessful attempts can be made ?
A salesperson by mistake multiplied a number and got the answer as 3, instead of dividing the number by 3.What is the answer he should have actually got?
The price of raw materials has gone up by 15%, labour cost has also increased from 25% of the cost of raw material to 30% of the cost of raw material. By how much percentage should there be a reduction in the usage of raw materials so as to keep the cost same