ISC PRACTICAL PROGRAMS -2025
ARRAY:
1. Write a program to arrange each row of a matrix a[ m][n] in ascending order, where the
values of both m and n must be greater than 2 and less than 10. Print the original and
the arranged arrays.
2. Write a program to create a square matrix of order m x m where m>=3 and m<=9 and
generate a mirror matrix. Print both the original and mirror matrix
e.g. Original matrix:
10 20 30
40 50 60
70 80 90
Mirror matrix:
30 20 10
60 50 40
90 80 70
3. Write a program to TRANSPOSE (row values become column and vice versa) a square
matrix a[n][n], where n>=2 and n<=9. Print the original and the transposed matrix.
4. From a square matrix a[m][m], where m>=3 and m<=10,
a. Print the values of the main diagonal
b. Print the sum of the elements which do not fall in either of the diagonals
Input:
92 45 68 60
0 81 79 20
23 67 40 11
12 5 7 25
Output:
Values of the main diagonal: 92 81 40 25
Sum : 179
5. Write a program to insert an array x[4] in a given POSITION entered by the user in
another array a[15] which contains 11 values in the first 11 elements. Print the original
array a[15] and the array after insertion.
e.g. : x[ ] = { 11,22,33,44}
a[ ]= { 5,8,3,9,4,0,2,4,1,7,7}
Position: 4
Output:
Original array: 5 8 3 9 4 0 2 4 1 7 7
Array after insertion: 5 8 3 11 22 33 44 9 4 0 2 4 1 7 7
6. An array a[15] contains few integers in ascending order. Pack the array i.e. remove the
extra occurrences of the same number.
e.g. : a[ ] ={2,2,2,2,5,8,8,8,11,11,25,26,27,27,27}
packed array: 2 5 8 11 25 26 27
Display the original and the packed array.
7. An array a[15] contains few integers. Enter a range m and n, where m>=0 and n<=14,
and arrange the values within that range (both m and n inclusive) in ascending or
descending order depending on user’s choice (A for ascending and D for descending).
e.g. a[ ]={3,6,2,8,12,8,5,82,34,78,23,9,11,56,7}
Input range: m= 3
n = 10
Order: D
Output: 3 6 2 82 78 34 23 12 8 8 5 9 11 56 7
Print the original array and the arranged array
STRING:
1. Write a program to accept a sentence and print all the palindrome words.
2. From a sentence print the frequencies of vowels and consonants of each word.
3. Enter a sentence in capital letters and arrange the words of it in alphabetical order.
e.g. : Input: THAT SEEMS TO BE A EASY ONE
Output: A BE EASY ONE SEEMS THAT TO
4. From a sentence print the alphabet with lowest ASCII code and the alphabet with
highest ASCII code from each word.
5. Encrypt a sentence using the given method. Replace each alphabet with the next second
alphabet of alphabetical order i.e. A be replaced by C, B replaced by D, C by E……..X by
Z, Y by A and Z by B.
Enter a sentence in uppercase and print the original and the encrypted sentences.
NUMBERS:
1. Write a program to input a number and check whether it is an EVIL number or not.
(EVIL number: It is a positive whole number which has even number of 1’s in its binary
equivalent.)
e.g. binary equivalent of 9 is 1001 which contains even number of 1s and so it is an evil
number
2. A triangular number is formed by the addition of consecutive integers starting with 1.
eg. 1+2=3
1+2+3=6
1+2+3+4=10
Write a program to display all the triangular numbers from 3 to n, taking the value of n
as input.
3. Write a program to accept an integer and
a. print all the prime digits from it
b. check for palindrome
4. Aminno number is a number which is of at least 3 digits and the differences between
the consecutive digits from left to right are in ascending order.
Write a program to enter a number and check for aminno number.
e.g.1: Input: 1248
Output: 1248 is an aminno number
e.g.2: Input: 13768
Output: 13768 is not an aminno number
e.g.3: Input: 25
Output: Number is of less than 3 digits
5. Write a program to check a number for Happy. (Happy number- number for which the
sum of the squares of the digits eventually equals 1)
e.g. 203 is happy because 22+ 02+32 = 13; 12 + 32 = 10 ; 12 + 02 = 1
6. Enter a range m and n where m>=10 and n<=300 and generate all the numbers within
the range (including m and n) which do not contain any prime digit.
e.g. Input range : m = 20
n = 50
Output: 40 41 44 46 48 49
7. Enter an integer and form a new number which will contain the even digits of that
number
in ascending order followed by the odd digits of that number in ascending order.
e.g. Input : 6453768
Output: 4668357