0% found this document useful (0 votes)
8 views4 pages

ISC Circular Primes and Goldbach Numbers

The document contains practice questions for ISC related to programming tasks involving circular primes, Goldbach numbers, matrix operations, sorting arrays, and word potential calculations. Each question specifies input requirements and expected outputs, along with examples. Additionally, it includes instructions for the practical examination, emphasizing algorithm writing, code implementation, documentation, and presentation.
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)
8 views4 pages

ISC Circular Primes and Goldbach Numbers

The document contains practice questions for ISC related to programming tasks involving circular primes, Goldbach numbers, matrix operations, sorting arrays, and word potential calculations. Each question specifies input requirements and expected outputs, along with examples. Additionally, it includes instructions for the practical examination, emphasizing algorithm writing, code implementation, documentation, and presentation.
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

Practice sets of questions for ISC

Read the note carefully given at the end of the document


Question 1.

A circular prime is a prime number with the property that the number generated at each intermediate
step when cyclically permuting its digits will be prime. For example, 1193 is a circular prime, since
1931, 9311 and 3119 all are also prime.

Write a program to print 1st n Circular Prime Numbers when ‘n’ is user input and n>10 and n<20.

Example 1
Input:
Enter n: 10
Output:
Circular Prime Numbers are:
2, 3, 5, 7, 11, 13, 17, 37, 79, 113

Example 2
Input:
Enter n: 25
Output:
Invalid Range!

Question 2

A Goldbach number is a positive even integer that can be expressed as the sum of two odd primes.
Note: All even integer numbers greater than 4 are Goldbach numbers.
Example:
6=3+3
10 = 3 + 7
10 = 5 + 5
Hence, 6 has one odd prime pair 3 and 3. Similarly, 10 has two odd prime pairs, i.e. 3 and 7, 5 and 5.
Write a program to accept an even integer 'N' where N > 9 and N < 50. Find all the odd prime pairs
whose sum is equal to the number 'N'.
Test your program with the following data and some random data:
Example 1
INPUT:
N = 14
OUTPUT:
PRIME PAIRS ARE:
3, 11
7, 7
Example 2
INPUT:
N = 30
OUTPUT:
PRIME PAIRS ARE:
7, 23
11, 19
13, 17
Question 3

Design a class Matrix to take an m × m (m > 2 and m<7) matrix from the user, print the matrix and
find the sum of the boundary elements and the sum of the primary diagonal.
Example 1
Input:
Enter m: 4
Enter the values:1
2
…..

Output:
The matrix is:

Sum of the boundary elements: 35


Sum of the primary diagonal: 17

Example 2
Input:
Enter m: 6
Enter n: 3
Output:
Invalid Matrix Size

Question 4
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:
1258
1251
1212
1125
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
137
131
113
Example 2
INPUT:
N = 13
OUTPUT:
MATRIX SIZE OUT OF RANGE

Question 5.

The potential of a word is found by adding the ASCII value of the alphabets.
(ASCII values of A to Z are 65 to 90).
Example: BALL
Potential = 66 + 65 + 76 + 76 = 283
Write a program to accept a sentence which may be terminated by either “ . ” , “ ? ” or “ ! ” only. The
words of sentence are separated by single blank space and are in UPPER CASE. Decode the words
according to their potential and arrange them in ascending order of their potential strength.
Test your program with the following data and some random data:
Example 1:
INPUT: HOW DO YOU DO?
OUTPUT: HOW = 238
DO = 147
YOU = 253
DO = 147
DO DO HOW YOU

Example 2:
INPUT: LOOK BEFORE YOU LEAP.
OUTPUT: LOOK = 309
BEFORE = 435
YOU = 253
LEAP = 290
YOU LEAP LOOK BEFORE

Example 3:
INPUT: HOW ARE YOU#
OUTPUT: INVALID INPUT

Question 6.

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 and are in UPPER CASE.
Perform the following tasks:
1. Check for the validity of the accepted sentence only for the terminating character.
2. Arrange the words in ascending order of their length. If two or more words have the same
length, then sort them alphabetically.
3. Display the original sentence along with the converted sentence.
Test your program for the following data and some random data:
Example 1:
INPUT:
AS YOU SOW SO SHALL YOU REAP.
OUTPUT:
AS YOU SOW SO SHALL YOU REAP.
AS SO SOW YOU YOU REAP SHALL
Example 2:
INPUT:
SELF HELP IS THE BEST HELP.
OUTPUT:
SELF HELP IS THE BEST HELP.
IS THE BEST HELP HELP SELF

Note:

Instructions for Computer Science Practical Examination

• Algorithm & Coding: First, write the algorithm and the program clearly on your answer
sheet.
• Implementation: Type the code into the computer and verify the outputs.
• Documentation: Ensure you add meaningful comments within your program to explain the
logic.
• Presentation: Your handwritten work and code should be neat, clean, and well-organized.
• Punctuality: Do not be late. All Computer Science students (Science, Humanities, and
Commerce) will be tested in a single batch.
• Timing: * Reporting Time: 8:30 am
o Departure: Approx. 12:45 pm
• Materials: Bring all necessary stationery items.
• Prohibited Items: No electronic gadgets (phones, smartwatches, etc.) are allowed in the lab.

You might also like