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

To 15 lts of water containing 20% alcohol, we add 5 lts of pure water. What is % alcohol.

1333


The house is big and lovely but since nobody uses it it is pretty much a white Elephant What does White Elephant mean?

1431


One skirt requires 3.75 yards of cloth. How many skirts you can make from 45 yards?

1280


in a school for a student out of a 100 he got 74 of average for 7 subjects and he got 79 marks in 8th subject. What is the average of all the subjects?

1271


what is the number whose reminder is 2 after dividing 5and also reminder is 4 after deviding 7 and reminder is 6 after deviding 9?

2265


The price of coffee increases by 20%, how much percent consumption of coffee should be reduced by Reema so that the expenditure on coffee remains the same.

1153


A person needs 6 steps to cover a distance of one slab. if he increases his foot length(step length) by 3 inches he needs only 5 steps to cover the slabs length. what is the length of the each slab.

1541


if 2 miles of fence enclose a square plot of 160 acres,how large a square will 4 miles of fence

6856


If m/n = 5/4 , then 2m+n= ?

1200


A boy picks up the phone and asks" who are you?" The voice from the other side answers" I am your mother's mother in law".What is the relation of the boy with the fellow speaking at the other end.

1606


A work is done by the people in 24 min. one of them can do this work a lonely in 40 min. how much time required to do the same work for the second person.

1266


how would you connect 8 dots with 3 lines.

1879


there is a 4 inch cube painted on all sides. this is cut into no of 1 inch cubes. what is the no of cubes which have no pointed sides.

1229


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

1570


33 1/3 of 101 + 296 is

1533