Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / rahulkashyaprajput

package repeatingno;
import java .io.*;
public class Reap
{
public static void main(String args[])throws IOException
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int no,max=0,n,count=0;
System.out.println("enter no of elements");
no=Integer.parseInt(br.readLine());
int ar[] = new int[no];
System.out.println("enter elements");
for(int i=0;i<no;i++)
ar[i]=Integer.parseInt(br.readLine());
for(int i=0;i<no;i++)
{
if(ar[i]>max)
{
max=ar[i];
}

}
System.out.println("repeated elements are");
for(int i=0;i<=max;i++)
{ for(int j=0;j<no;j++)
{
if(i==ar[j])
count++;
}

if(count>1)
System.out.print(i+" ");
count=0;
}

}
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

a bus started from bus stand at 8.00am and after 30min staying at destination it returned back to the bus stand.the destination is 27 miles from the bus stand the speed of the bus 50percent fast speed at what time it returns to the bus stand.

1187


the average of seven numbers is 2.5 then their product

1043


Could anyone please email the answers to the verizon 2014 aptitude test

2312


In Bangalore, during income tax deduction for a single person, the percentage increased by 3% and for middle house-holders, it decreased by 3%. What can you infer?

1137


A man buys 12 lts of liquid which contains 20% of the liquid and the rest is water. He then mixes it with 10 lts of another mixture with 30% of liquid.What is the % of water in the new mixture?

1349


Find the number WXYZ divisible by 36? i) Let the digits be5, 4,3,6 -not in that order ii) Sum of last two digits is 9 iii) Sum of middle two digits is 7->If one is sufficient then ans as A || if two is sufficient then ans as B || if all are necessary then ans as C || if nothing is needed then

1156


A person went to shop and asked for change for 1.15 paise. But he said that he could not only give change for one rupee but also for 50p, 25p, 10p and 5p. What were the coins he had ?

1356


1992 Feb have 5 Sundays. In which year, the month Feb have 5 Sundays next?

1161


X < 0, Y <> 0 then what is the possibility that the result is always positive?

1503


Three friends divided some bullets equally. After all of them shot 4 bullets the total no.of remaining bullets is equal to that of one has after division. Find the original number divided.

1094


A man, a woman, and a child can do a piece of work in 6 days. Man only can do it in 24 days. Woman can do it in 16 days and in how many days child can do the same work?

1160


sir i need rrb secunderabad goodsguard previous exam papers

2249


The ratio of no. of boys & girls in a school is 3:2 Out of these what % the boys & 25% of girls are scholarship holders. % of students who are not scholarship holders.?

1169


What is your objeective in career ?

2566


A company installed 36 punching machines at the beginning of the year.In the spring they installed 9 additional m/c's and then discontinued 18 in the fall.How many were still installed at the end of the year?

1200