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

A person has his own coach&whenever he goes to railway station he takes his coach.One day he was supposed to reach the railway station at 5 O'clock.But he finished his work early and reached at 3 O'clock. Then he rung up his residence and asked to send the coach immediately. He came to know that the coach has left just now to the railway station.He thought that the coach has left just now to the railway station.He thought that he should not waste his time and started moving towards his residence at the speed of 3min/hr.On the way,he gets the coach and reaches home at 6 o'clock.How far is his residence from railway station.

1213


If x,y,z are three consecutive natural numbers, which of the following numbers should be x+y+z

1166


In a typical motor cycle rally, every motor cycle has to reach a speed of 20 m/min within a minute and it increase its speed by 20 m/min and the sum was 1600 m/min. Four minutes later, a new motor cyclist started running in the race. After another two minutes, the motor cyclist with the speed of 400 m/min stopped due to injuries and again two new motor cyclist started running in the race. What is the current average speed?

1102


Three years ago my uncle offered me a used keyboard for Rs. 1024. A year later he offered me the same for Rs. 640 and last year he wanted Rs. 400 and now he is willing to sell it to me for Rs. 250. But I have decided to buy it when he reduces the price next time. If he is constantly reducing its price, at what price will he offer the keyboard to me next?

1166


what is the angle between two hands of a clock when time is 8-30

1183


In a show, ticket numbers from 101 to 350 are made to sit consecutively. What is the probability that the number of the ticket, selected at random, will be a hundredth digit of 2?

1202


The cost of 16 articles is equal to sell price of 12 articles. The gain percent is ?

1344


In a digital circuit which was to implement (A B) + (A)XOR(B), the designer implements (A B) (A)XOR(B) What is the probability of error in it ?

1475


A sales person multiplied by a number and get the answer 3. Instead of that number divided by 3. What is the answer she actually has to get. (1/3) * 1 *3 =3 so the no= 1 divided by three.

1207


A sum of money becomes 2.5 times itself at 12.5% simple interest p.a. What should be the period of investment to get this much return?

1228


If D is adjacent to F then who is adjacent to C?

1874


there is a matrix N x N .Its elements consist of either value =1 or value=0. If there is a any zero in the row, then the output matrix should have all zeroes in that row. If there is a single zero in any column then that column should have all zeroes n the output matrix. write the function to perform these operations. i want a solution in c/c++ language

2312


Find the next number in the series. 1, 0.5, 0.25, 0.125

1482


Find the next series: SE QU EN TI ?

1279


Ms. Neelam deposits an amount of Rs. 16420 at simple interest and obtained 25451 at the end of 5 years. What was the rate of interest per year?

1156