Write a function that will read in 20 numbers each of which

Write a function that will read in 20 numbers, each of which is between 10 and 100, inclusive, and save them in an array. Then, write another function that will analyze each number from the array and print it only if it is not a duplicate of a number already in the array. You are NOT allowed to use more than the one array created in the beginning.

Solution

#include<conio.h>
int a[20];
void read();
void analyse();

int main()
{

read();
analyse();
getch();
return 0;
}
void read(){
int n;
printf(\"enter 20 elements\");
for(int i=0;i<20;i++){
scanf(\"%d\",&n);
if(n>=10 && n<=100){
a[i]=n;
}
}

}
void analyse(){
int flag=0;
for(int i=0;i<20;i++){
for(int j=i+1;i<20;j++){
if(a[i]==a[j]){
flag=1;
}
}
if(flag==0)
printf(\"%d\",a[i]);
}
  
}

 Write a function that will read in 20 numbers, each of which is between 10 and 100, inclusive, and save them in an array. Then, write another function that wil

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site