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

If each of the numbers A, B and C are divisible by 2, then A*B*C must be divisible by

1191


In a party man & his wife ,and there r 2 son with their wives, and every son has 4 children in his family .how manyperson r in party.

1133


THERE ARE 3 PILES OF BOOKS ON THE TABLE YOU NEED TO ARRANGE THEM IN THE SELF SUCH THAT 1ST BOOK OF EACH PILE GETS PLACED ON THE SELF,WHAT IS THE POSSIBLE NO OF ARRANGEMENTS

3585


58,27,12,x,2,1. Find x.

1349


4 couples have a party.Depending on the set of statements,find who insulted whom and who is the host of the party.

1318


A person grows cabbage, he uses a larger square this year than previous year and produces cabbages than previous year.what is the no. of cabbages produced this year

1176


How is the father of the man ,who is the brother of the only aunt of my brother related to me?

1143


02: 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen?

1441


2 persons start from a pt. and go in opposite directions. After going 3 km they turn left and walk 4 km . how far r they now?

1909


If A=Z, B=Y, C=X, .......... Z=A, Then ZERD = ?

1220


Can you find out what day of the week was January 12, 1979?

1348


Find the next series number : 21, 463, 687, 238, 1134, ----

1032


If a man buys 1 lt of milk for Rs.12 and mixes it with 20% water and sells it for Rs.15, then what is the percentage of gain?

1176


When Raja was born, his father was 32 years older than his brother and his mother was 25 years older than his sister. If Raja’s brother is 6 years older than Raja and his mother is 3 years younger than his father, how old was Raja’s sister when Raja was born?

1337


All people use a bus paid equalty. 40 seats in the bus.Bus charge is Rs. 70.37. How many seats we left unfilled?

1235