Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Military Institute of Science and Technology Department of Computer Science and Engineering CSE-305 Array & String Practice Problems

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

MILITARY INSTITUTE OF SCIENCE AND TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


CSE-305 Array & String Practice Problems

1. Write an assembly language program to take an input n which is size of an array and take decimal input as
element of the array. Then print the even elements from the Array.

Sample Input Sample Output


Enter the size of the array 12 50 20 10
6
Enter the elements of the array
12 11 23 50 20 10

2. Write an assembly language program to take decimal input in two different arrays and print the Maximum
Number and Minimum Number from arrays. Also calculate the average of two array elements.

Sample Input Sample Output


Enter the elements of 1st array Maximum Element: 50
12 23 5 24 20 10 Minimum Element: 10
Enter the elements of 2nd array Average: 20
19 11 50 24 22

3. Write an assembly language program to take an input n which is size of an array and take digits (0-9) as
element of the array then print all the Repeated Numbers with Frequency in the Array

Sample Input Sample Output


Enter the size of the array 1 occurred 2 times
7 3 occurred 3 times
Enter the elements of the array 4 occurred 2 times
1343413

4. Take input in two arrays. Then Store the union & intersection of two input arrays in first array and second
array consecutively, then print both array.

Input: Input:
1st array: 23 31 22 12 45 36 1st array: 33 12 42 35
2nd 2nd array: 12 32 22 16 27 2nd array: 42 35 21 23
Output: Output:
Union: 23 31 22 12 45 36 32 16 27 Union: 33 12 42 35 21 23
Intersection: 12 31 22 Intersection: 42 33 35
5. Write an assembly language program to take 2 strings as input and concatenate the two strings and print
the concatenated string. Also check whether it is a palindrome or not.

Enter the first string: Enter the first string:


bangla race
Enter the second string: Enter the second string:
desh car
Concatenated String: Concatenated String:
bangladesh racecar
Not palindrome Palindrome

6. Write an assembly language program to take a string as input and take another input as position. Delete
the char of input position to and print the entire string.

Sample Input Sample Output


Enter the string: Register
Regiister
Give a position input from where you want to delete character:
4

7. Write an assembly language program to take a string as input and reverse every word of the string.

Sample Input Sample Output


Enter the string: Reversed Output:
Military Institute of Science and Technology yratiliM etutitsnI fo ecneicS dna ygolonhceT

8. Write an assembly language program to take a string as input and print the longest word and smallest
word.

Sample Input Sample Output


Military Institute of Science and Technology Longest Word: Technology
Smallest Word: of

You might also like