Assignment 4 | PDF | String (Computer Science) | Matrix (Mathematics)
0% found this document useful (0 votes)
56 views

Assignment 4

The document contains 36 questions related to arrays and strings in C programming. It asks to write programs that perform operations like initializing and displaying arrays, sorting arrays, searching arrays, matrix operations, and string manipulation tasks like checking palindromes, concatenating, and manipulating substrings.

Uploaded by

Bishal Shahi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Assignment 4

The document contains 36 questions related to arrays and strings in C programming. It asks to write programs that perform operations like initializing and displaying arrays, sorting arrays, searching arrays, matrix operations, and string manipulation tasks like checking palindromes, concatenating, and manipulating substrings.

Uploaded by

Bishal Shahi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment-4

(Array and String)


1. What is an array? Explain different types of array. (declaration, initialization and examples)
2. List the uses of one dimensional and two dimensional arrays.
3. What is string? Explain different string manipulation functions.
4. Write a program to initialize 10 numbers in an array and display them.
5. Write a program to read N numbers from user and display the numbers, their sum and average.
6. Write a numbers to find largest and smallest number from set of N numbers entered by users.
7. Write a program to read N numbers and sort them in ascending order. (Using bubble sort)
8. Write a program to read N numbers and sort them in ascending order. (Using Selection sort)
9. Write a program to search an item in an array. (using linear search technique)
10. Write a program to search an item in an array. (using binary search technique)
11. Write a program to read N items and sort them in ascending or descending order depending upon
user choice. ( for e.g. 'a' for ascending and 'd' for descending)
12. Write a program to read N numbers in an array and find the sum of odd numbers.
13. Write a program to read N numbers in an array and then increment the elements by constant C,
where C is entered by users.
14. Write a program to read age of 20 peoples and count the numbers of child, teen, adult, young, and
old. Given
 Age<13 -- child
 Age>=13 and age<20 – TEEN
 Age>=20 and age<31 – Adult
 Age>=31 and age<55 – Young
 Age>=55 – Old
15. Write a program to read N numbers and display only prime numbers.
16. Write a program to read salary of N employees and count the numbers of employee receiving salaries
between 40000 to 60000.
17. Write a program to add two matrices by asking matrix order from user.
18. Write a program to find the sum of rows and column of matrix.
19. Write a program to multiply matrices a A and B.

−1 1
1 5 2
‫=ܣ‬ቂ ቃ ‫ = ܤ‬൥ 2 3൩
3 4 6
5 2
20. Write a program to multiply two matrices by asking size from user.
21. Write a program to transpose a matrix.
22. Write a program to find sum of diagonal elements of square matrix.
23. Write a program to convert string into upper case without using function.
24. Write a program to find reverse of string without using function.
25. Write a program to copy string without using function.
26. Write a program to concatenate string without using function.
27. Write a program to check whether a word is palindrome or not.
28. Write a program to read line of text and count number of vowels, consonant, digits, white spaces and
other characters.
29. Write a program to check whether a word is palindrome or not using function.
30. Write a program to read line of text and delete all the occurrence of word "that".
31. Write a program to read a line of text and search the substring from that line.
32. Write a program to remove all space from a line of text.
33. Write a program to count numbers of words from line of text.
34. Write a program to read name of N student and display in monitors.
35. Write a program to read N words and sort them in alphabetical order.
36. Write a program to sort {aman, akesh, anish, anam, anil, anju} in alphabetical order.

You might also like