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 the value of ( 0.75 * 0.75 * 0.75 - 0.001 ) / ( 0.75 * 0.75 - 0.075 + 0.01)?
The perimeter of a rhombus is 52 units. One of its diagonal is 24 units.What is its second diagonals length?
A small town's industries have a total turnover of Rs. 25,00,000. If the town council plans to raise Rs.170,000 through octroi levy, what % levy should it charge on the industries?
Two trains leaving from two station 50 miles away from each other with constant speed of 60 miles per hour, approaches towards each other on different tracks. if length of each train is 1/6 mile. when they meet How much time they need to pass each other totally ?
A chain is broken into three pieces of equal lenths containing 3 links each. It is taken to a backsmith to join into a single continuous one . How many links are to to be opened to make it ?
There are three trucks A, B, C. A loads 10 kg/min. B loads 13 1/3 kg/min. C unloads 5 kg/min. If three simultaneously works then what is the time taken to load 2.4 tones?
Find the physical quantity represented by MOMENTUM * VELOCITY] / [LENGTH * ACCELERATION]?
In a club there are male and female members. If 15 female quit then the number of males will become double the number of males. If 45 males quit no. of female becomes five times the number of males. Find the number of females.
modulo(373,7)+round(5.8)+truncat(7.2)-round(3.4) = ? i exactly don't remember the truncate function.but the function was where we skip the '.' part.
chief : tribe :: governor :
A Lorry starts from Banglore to Mysore At 6.00 a.m, 7.00 a.m, 8.00 a.m.....10 p.m. Similarly another Lorry on another side starts from Mysore to Banglore at 6.00 a.m, 7.00 a.m, 8.00 a.m.....10.00 p.m. A Lorry takes 9 hours to travel from Banglore to Mysore and vice versa.?
two workers can type two pages in two minuets then how many persons can type 18 pages in 6 minuets
plz send Karur Vysya Bank Clerk exam previous model papers to saraphin21@gmail.com....
A, B ans C are three speakers. They have to speak randomly along with another 5 speakers in a function. A has to speak before B and B has to speak before C. What is the probability.
There are 4 boys and 3 girls. What is the probability the boys and girls sit alternately?