Introduc) On To C Language Lab Assignment 4 (Batch)
Introduc) On To C Language Lab Assignment 4 (Batch)
1. Write a C program to declare a 1-D array of size 10. Ini;alize the array and
display the array. Determine the sum and products of elements of array and
display them.
2. Write a c program that compares two integer arrays to see whether they are
iden;cal or not. This program prints 1 if they are iden;cal, 0 otherwise.
3. Write a C program to declare a 1-D array of size 10. Ini;alize the array and
then swap the largest and smallest element of the array. Display the array before
and aDer swapping.
5. Write a C program to swap the 1st and last element of a 1-D array of size 10.
Display the array before and aDer swapping.
6. Write a C program to declare a 1-D array of size 10. Ini;alize the array and
display them. Display the array in reverse order.
8. Write a program in C to separate odd and even integers into separate arrays.
9. Write a C program to input n numbers in an array, calculate the sum of all even
numbers and all odd numbers in the array and print the larger sum.
10. Given are two one-dimensional arrays A and B which are sorted in ascending
order. Write a program to merge them into a third single sorted array that
contains every item from arrays A and B, in ascending order.