Try to find out the duplicate element while inserting an integer element into an array of size 100. The inter numbers should 1 to 99. If i start inserting the number from 1 to 99 randomly without repeating the previous inserted element into array. At the instance if the number repeats we have find the index of the array and we have to find out the duplicated number and return.
Example:
array[0]=3;
array[1]=7;
array[2]=88;
array[3]=45;
array[4]=33;
array[5]=99;
array[6]=7;
At this stage the C program should exit and display the information as duplicated element is 7 and index = 6;
Write a C Program using only one "for loop".
Only one for loop to be used is the constraint.
Example:
array[0]=3;
array[1]=7;
array[2]=88;
array[3]=45;
array[4]=33;
array[5]=99;
array[6]=7;
At this stage the C program should exit and display the information as duplicated element is 7 and index = 6;
Write a C Program using only one "for loop".
Only one for loop to be used is the constraint.
Comment