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 N stations on a railroad. After adding x stations 46 additional tickets have to be printed. Find N and X.
2, 3, 6, 7--- using these numbers form the possible four digit numbers that are divisible by 4.
Two trains are traveling in 60 kmph on same trace, towards each other. When the distance between them is 18 km, a fly is going to start, flying between them in 80 kmph speed. Find the traveling path distance of the fly upto when it is going to crush by the 2 trains?
A & B can do a piece of work in 21 & 24 days respectively. The started to work together but after some days BA leaves, B completes the remaining work in 9 days. After how many days does A leaves
please let me know the minimum qualifying marks in screening test of group1 2010 to be eligible for group1 main exam.
In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years.
A mother is 30 years older than her daughter however she will be only thrice as old as the daughter after 5 years. What is mother’s present age ?
How Can A Cake(circular) Be Cut Into 8 Pieces By Making Just 3 Cuts?
There are 5 questions based on a murder story.the questions concentrate on the seating arrangements of people mentioned.
Two persons start at the same point, walk in opposite directions with 5km/hr and 5.5km/hr respectively. What is the distance separated after 2 and half hrs?
a grandfather has 5 sons and daughters and grandchildren.they have to be arranged in a row such that the first 4 seats and last four seats are to be taken by grandchildren and the grandfather would not sit adjacent to any of the grandchildren.
How many digits will be there to the right of the decimal point in the product of 95.75 and .02554 ?
what is diff b//w the singly reinforced beam,doubly reinforced beam?
4 pipes inlet and 2 pipes outlets, find water inlet etc.
A says Party was held on :Thursday ,May 8th. B says Party was held on :Tuesday,May 10th. C says party was held on :Friday ,June 8th. Given April 1 st was Tuesday.one of A,B,C says 1 correct.one says 1 wrong.and one was completely wrong of date,Month and day. Find the Day the party held.