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 / amit kumar mehta

#include<iostream>
using namespace std;

int main() {
int a[] = {1,3,23,11,44,3,23,2,3};
// for ( i = 0; i < 10; ++i) {
// cin >> a[i];
// }
for ( int i = 0; i < 9 ; i++) {
int count = 0;
for (int j = i+1; j < 9; j++) {
if (a[i] == a[j]) {
count++;
}
}
if (count > 0) {
int temp[10];
int rep = 0;
for (int m = 0; m < 10; ++m) {
if (a[i] == temp[m]) {
rep++;
}
}
if (rep <= 0) {
cout << a[i] << " ";
temp [i] = a[i];
}
}
}
return 0;
}

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Ramesh sit around a round table with some other men. He has one rupee more than his right person and this person in turn has 1 rupee more than the person to his right and so on, Ramesh decided to give 1 rupee to his right & he in turn 2 rupees to his right and 3 rupees to his right & so on. This process went on till a person has 'no money' to give to his right. At this time he has 4 times the money to his right person. How many men are there along with Ramesh and what is the money with poorest fellow.

1233


FIND the next number in the series 11,112,1124,11248,--

1239


A person was fined for exceeding the speed limit by 10 km/hr. Another person was also fined for exceeding the same speed limit by twice the same. If the second person was traveling at a speed of 35km/hr,find the speed limit?

1393


The ratio between the perimeter and the breadth of a rectangle is 5: 1. What is the length of the rectangle If the area of the rectangle is 216 sq. cm?

1400


A hotel has 10 storeys. Which floor is above the floor below the floor, below the floor above the floor, below the floor above the fifth.

1891


a circular track has 100yards. The race of Rabbit and TOuttoise. they started at same point. and move in circular path. in opposite direction.first tortoise run for 1/8 th path, then only rabbit starts,rabbit moved slowly till tortoise meet him, Rabbit had covered 1/6 th distance speed( over earlier speed) to win

1462


if f(x)=1/x then f(f(f(x))) equals

1386


A chain is broken into three pieces of equal lengths 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 ?

2168


There are 6 people W,H,M,C,G,F who are murderer , victim , judge , police, witness, hangman. There was no eye witness only circumtancial witness. The murderer was sentenced to death. Read following statement and determine who is who.

1220


If the word FADENCOMT equals 345687921 then What is FEAT. Find representation of 2998

1477


two workers can type two pages in two minuets then how many persons can type 18 pages in 6 minuets

1458


Successive discounts of 10%, 20% and 20% are equal to a single discount of __

1206


Find the unit digit of product of the prime number up to 50 ?

1620


how to retrieve the recent record from the database using sql query. suppose the table has the columns only ename,job,salary columns

2312


What is the probability of getting a sum 9 from two throws of a dice?

1460