Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define Nums 21
- #include <iostream>
- using namespace std;
- int main (void){
- int numbers [Nums]={0};
- int isDuplicate, user_input;
- int a,z;
- int numberofinputs = 0;
- cout << "Please enter 21 numbers" << endl;
- for (a=0; a<= Nums-1, a++)
- isDuplicate=0;
- scanf ("%d", &user_input);
- for (z=0; z<numberofinputs; z++){
- if(user_input =numbers[z]){
- isDuplicate=1;
- break;
- }
- }
- if(!isDuplicate){
- numbers[numberofinputs++]=user_input;
- }
- }
- cout << "Non duplicate numbers are " << endl;
- for (a=0; a<Nums && numbers[a]!=0;a++){
- cout << "(%d,numbers [a]" << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement