0% found this document useful (0 votes)
17 views3 pages

Arrays

The document discusses various array programs in C including adding even and odd numbers in an array, finding the largest and smallest numbers, counting prime numbers, finding the second largest and smallest, reversing and modifying arrays, removing duplicates, and implementing a stack.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Arrays

The document discusses various array programs in C including adding even and odd numbers in an array, finding the largest and smallest numbers, counting prime numbers, finding the second largest and smallest, reversing and modifying arrays, removing duplicates, and implementing a stack.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Arrays

---------------------------------------------------------------------------------------------------------------

1) Write a C program to input 10 numbers through the keyboard into an array and
display the results of addition of even numbers and product of odd numbers.

2) Write a C program to input 10 numbers through the keyboard into an array and find the
biggest and smallest number in an Unsorted array without using any Sorting Technique.

3) Write a C program to input 10 numbers through the keyboard and find the number
of prime numbers count, store them into a seperate array and display it.

4) Write a C program to findout second largest and second smallest elements of an


unsorted array without using any Sorting Technique.

5) Write a C program to reverse the elements of a given array.

6) Write a C program to delete an element at desired position from an array.

7) Write a C program to insert an element at desired position in an array.

For Example if 'A' is to be


stored at '0' position then,
8) Write a C program which deletes the duplicate elements of an array.

9) Write a C program to find the duplicate elements of a given array and find the count of
duplicated elements.

Ex: if int a[] = {0,3,1,0,5,1,2,0,4,5}

output : -
The duplicate elements are existed in an array
0 -- 3 times
1 -- 2 times
5 -- 2 times

10) Write a program to print the non repeted numbers of a given array.
Ex : if int a[] = {0,3,1,0,5,1,2,0,4,5}

Output : 3, 2, 4

11) Write a program to copy the elements of one array into another array without duplicate
items as a first slot, and store duplicate elements as a second slot.

Ex: source array {10,2,4,5,2,1,3,4,6,5,8,9,2}

destination arrays {10,2,4,5,1,3,6,8,9} , { 2,2,4,5}


first slot second slot

Take two different arrays for first and second slots.

12) Write a C program to evaluate the following series. The series contains sum of
square of numbers from 1 to 'n'. Strore result of each term in an array. Calculate
value of ' S ' using array.

S = 1^2 + 2^2 + 3^2 + 4^2 + ------ n^2


= [ 1, 4, 9, 16, -------- n^2 ]

Suppose n = 4,

then S = 1^2+2^2+3^2+4^2;
S = 1+4+9+16;
S = 30.
13) Write a C program to implement the stack using arrays.

STACK

-------------------------------------------------------- END --------------------------------------------------------

Dear Students, if any mistakes found, Kindly inform to me.

You might also like