answersLogoWhite

0


Best Answer

#include<stdio.h>

int main ()

{

int size,a[100];

int i,j,k;

printf("Enter size of the array\n");

scanf("%d",&size);

printf("Enter elements of the array\n");

for(i=0;i<size;i++)

scanf("%d",&a[i]);

for(i=0;i<size;i++)

{

for(j=i+1;j<size;j++)

{

if(a[i]==a[j])

{

for(k=j;k<size;k++)

{a[j]=a[j+1];

size--;

}

}

}

}

for(i=0;i<=size;i++)

printf("%d\t",a[i]);

return 0;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write c program to print common elements from two given arrays?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program to read your name and reverse it using arrays?

abdulrahman


Write a program to find intersection between two arrays?

#include&lt;stdio.h&gt;


How do you write c program to perform sum of elements of matrix using pointers with functions?

i cant write


How are arrays processed?

Usually one element at a time. If you want to process all elements of an array, you write a loop.Usually one element at a time. If you want to process all elements of an array, you write a loop.Usually one element at a time. If you want to process all elements of an array, you write a loop.Usually one element at a time. If you want to process all elements of an array, you write a loop.


Write a program using iostreams to take as input two multi-dimensional arrays and print their sum as output Matrix Addition in Matrix format?

http://www.assignmentsclub.com/


How do you write a java program to find the transpose of the matrix for the given elements?

You basically write a nested for loop (one for within another one), to copy the elements of the matrix to a new matrix.


Write a C program using dynamic memory allocation to find the sum of elements of a matrix?

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.


What type of program do you use to write a letter?

The most common is Microsoft Word


Would you Write c plus plus program using array for Fibonacci number?

You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....


Write a program demonstrating the usage of pointers with one dimensional and two dimensional arrays?

int main (int,char* argv[]) { int i, for (i=0;i&lt;arg;++i) printf ("% 2d:% s\a";i,argv[i]); return o; }


How do you write a programme in c language using arrays to copy diagonal elements of a 2-d array into a 1-d array?

TO use a c language first step is to know about the c language and the steps to use the c progrmming language with the help of any elders or with the teachers. TO use the arrays you have to get th eknowledge of "c" language


How do you write a program that calculates the sum of the matrix elements given numbers?

ring me and ill explain - 086 22222222222222227 ring me