0% found this document useful (0 votes)
58 views2 pages

Computer ISC Project

The document describes two programs. The first program declares a single-dimensional array and square matrix, allows user input into the array, sorts the array, and fills the matrix with the sorted array values. The second program accepts a sentence terminated by '.' or '?', converts the first letter of each word to uppercase, and displays each word with the number of vowels and consonants.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views2 pages

Computer ISC Project

The document describes two programs. The first program declares a single-dimensional array and square matrix, allows user input into the array, sorts the array, and fills the matrix with the sorted array values. The second program accepts a sentence terminated by '.' or '?', converts the first letter of each word to uppercase, and displays each word with the number of vowels and consonants.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM 2:-

Write a program to declare a single-dimensional array a[] and a square matrix


b[][] of size N, where N > 2 and N < 10. Allow the user to input positive integers
into the single dimensional array.

Perform the following tasks on the matrix:

1. Sort the elements of the single-dimensional array in ascending order using


any standard sorting technique and display the sorted elements.
2. Fill the square matrix b[][] in the following format:
If the array a[] = {5, 2, 8, 1} then, after sorting a[] = {1, 2, 5, 8}
Then, the matrix b[][] would fill as below:

1 2 5 8
1 2 5 1
1 2 1 2
1 1 2 5

3. Display the filled matrix in the above format.

Test your program for the following data and some random data:

Example 1

INPUT:
N=3
ENTER ELEMENTS OF SINGLE DIMENSIONAL ARRAY: 3 1 7

OUTPUT:
SORTED ARRAY: 1 3 7
FILLED MATRIX

1 3 7
1 3 1
1 1 3

Page | 49
PROGRAM 24-

Write a program to accept a sentence which may be terminated by either ‘.’ or ‘?’
only. The words are to be separated by a single blank space. Print an error
message if the input does not terminate with ‘.’ or ‘?’. You can assume that no
word in the sentence exceeds 15 characters, so that you get a proper formatted
output.

Perform the following tasks:


(i) Convert the first letter of each word to uppercase.
(ii) Find the number of vowels and consonants in each word and display them
with proper headings along with the words.

Page | 151

You might also like