#include
int main(){
int arr[50];
int *p;
int i,j,k,size,n;
printf("\nEnter size of the array: ");
scanf("%d",&n);
printf("\nEnter %d elements into the array: ",n);
for(i=0;i scanf("%d",&arr[i]); size=n; p=arr; for(i=0;i for(j=0;j if(i==j){ continue; } else if(*(p+i)==*(p+j)){ k=j; size--; while(k < size){ *(p+k)=*(p+k+1); k++; } j=0; } } } printf("\nThe array after removing duplicates is: "); for(i=0;i < size;i++){ printf(" %d",arr[i]); } return 0; } By Amandeep Singh :)
To detect the duplicate, you will have to write a nested loop that compares each element with all the previous elements.To actually delete the duplicate, once you find it, you have to move over all the elements after the duplicate. If the order of the elements doesn't matter, it is faster to just move the LAST array element, overwriting the duplicate element. Use a variable to keep track how many elements of the array are "usable". For example, if your array had 10 elements, and you delete 1, the array size will still be 10... but (after moving the elements over) only 9 of those elements have useful information.
i cant write
You basically write a nested for loop (one for within another one), to copy the elements of the matrix to a new matrix.
1. write a 'c' program to read 4(four)numbers from a file 'BANK' and calculate the average of the numbers.Now print the calculated average in another output file 'AVERAGE' 2. write a 'c' program that finds the sum and average of inputted five integer numbers of the array using dynamic memory allocation function malloc(). 3. write a 'c' program to create simple elements 1,2,3,4 in the link list of 4(four)nodes and display the list's elements. 4. write a 'c' program to convert the expression (A+B)/(C+D) into postfix expression into stack.and then evaluate it for A=10,B=20,C=15,D=5 and display the stack status after each operation. 5. write a 'c' programto create a linked list implemented on an array containing the following numbers:1,2,3,3,3,4,4,9 and pack it to remove the duplicate numbers.so that only the following data are contained by the nodes:1,2,3,4,9
Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.
ring me and ill explain - 086 22222222222222227 ring me
write"/more" in comands
How to write a program for secant method by mathematica
Program data dependence refers to the coupling of data stored in files and the specific programs required to update and maintain those files such that changes in programs require changes to the data. In a tradition file environment, any change in a software program could require a change in the data accessed by that program.
I tried to duplicate your 'error' - and it didn't do it on my copy of writer (OpenOffice version 3.3) - However, in the Calc program, it did change the format. The solution there, was to re-format the cell.
write a lex program to delete space from the program
write a vb program to find the magic square