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
A batsman scored 120 runs including 16 fours and 2 sixes. What percentage of his total score did he make by running between the wickets?
If a and b are positive integers and (a-b)/3.5 = 4/7, then the relation between a and b is
a father is 30 times more than his son however he will be only thrice as old as the son what is father's present age ?
in 8*8 chess board what is the total number of squares refer odel
The cycle has following specifications: The rear derailer is on the 14 tooth gear and the front derailer is on the 52 tooth gear. The rear gear has 14 teeth. The diameter of the rear wheel is 27". If a cyclist pedals at 75 revolutions per minute, then what will be the speed achieved?
A 2D array is declared as A[9,7] and each element requires 2 byte.If A[ 1,1 ] is stored in 3000. Find the memory of A[8,5] ?
A car is filled with four and half gallons of fuel for a round trip.If the amount of fuel taken while going is 1/than the amount taken for coming, what is the amount of fuel consumed while coming back?
A chain is broken into three pieces of equal lengths containing 3 links each. It is taken to a blacksmith to join into a single continuous one. How many links are to to be opened to make it ?
sir i need rrb secunderabad goodsguard previous exam papers
In the given figure, PA and PB are tangents to the circle at A and B respectively and the chord BC is parallel to tangent PA. If AC = 6 cm, and length of the tangent AP is 9 cm, then what is the length of the chord BC?
Two people X & Y walk on the wall of a go down in opposite direction. They meet at a point on one side and then go ahead. X after walking for some time, walks in opposite direction for 15 mtrs.Then again he turns back and walks in the original direction. What distance did Y walk before they met again, if X walks 11 mtrs by the time Y walks 8 mtrs.
A contractor employed 200 men to complete a strip of highway in 200 days. After 150 days he found that only 3/5th of the strip is complete. How many additional men should be employed to complete the work on time?
I want the sbi clerical exam model papers
Imagine 4 persons A,B,C,D.(It is a strength determining game). A found it hard,but could pull 'c' and 'd' to his side. AC and BD pairs on opposite sides found themselves equally balanced. When A and B exchanged their positions to form pairs AD and BC ,BC pair could win and pull AD to their side.Order the 4 persons in Ascending order according to their strengths.
A person goes 4/5 of his usual speed reaches 10min late to his destination, time taken?