Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Worksheet on array
1. Write C++ Program to find Maximum or Largest number in array.
2. Write C++ Program to enter 5 numbers & display first and last only. 3. Write C++ Program to Sort an Array Elements in Ascending Order 4. Write C++ Program for Addition of two matrix 5. Write C++ Program to Find Sum of Elements of an Array. 6. Describing the following components of array. a) Index b) Element c) Size 7. Write C++ Program to Find Even & Odd Elements in Array 8. Write C++ program to Insert element at specific position in array 9. Write C++ Program to Find Smallest Element in Array 10. Write C++ Program to Calculate Average of elements in an Arrays 11. Write the output a. #include<iostream.h> int main(){ int arr[5][3] = {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15}}; for (int i = 0 ; i < 3; i++) { for (int j = 0; j < 3; j++) { cout << arr[i][j]<<" " ; } cout << endl; } return 0; } b. #include<iostream.h> int main(){ int array[4]={4,1,15,25}; int a,b,c; a=++array[1]; b=array[1]++; c=array[a++]; cout<<a<<b<<c; return 0; } 12. Write C++ Program to Multiply Two Matrix Using Multi- dimensional Arrays 13. Write a program to find the sum and product of all elements of an array. 14. Write a C++ program to Convert Lowercase string to Uppercase 15. Write a C++ program to Convert Uppercase String to Lowercase. 16. Write a C++ program to Find Length of String 17. Write a C++ program to Compare Two Strings 18. Write a C++ program to concatenate two string 19. Write a C++ program to Copy String into another String 20. Write a C++ program that reads three strings and prints them out in an alphabetical order.(Hint: Use the strcmp() function).