The Programming Project: Palindrome
Showing posts with label Palindrome. Show all posts
Showing posts with label Palindrome. Show all posts

Tuesday, April 15, 2014

ISC Computer Science Practicals, 2012


/* A prime palindrome integer is a positive integer (without leading zeros) which is prime as well as a palindrome.
Given two positive integers m and n, where m < n, write a program to determine how many prime-palindrome integers
are there in the range between m and n (both inclusive) and output them.
The input contains two positive integers m and n where m < 3000 and n < 3000.
Display the number of prime palindrome integers in the specified range along with their values in the format specified below:

Test your program with the sample data and some random data:

Example 1:
INPUT: m=100
N=1000

OUTPUT: The prime palindrome integers are:
101,131,151,181,191,313,351,373,383,727,757,787,797,919,929
Frequency of prime palindrome integers: 15

Example 2:
M=100
N=5000

OUTPUT: Out of range */

/* ISC COMPUTER SCIENCE PRACTICALS,2012 Solved */

CODE


Tags: ISC, Computer Science, Practicals, 2012, Prime, String.valueOf(), Palindrome, Integer to String, Prime Palindrome

Saturday, April 12, 2014

ISC Computer Science Practicals Solved, 2013


/*
A palindrome is a word that may be read the same way in either direction.
Accept a sentence in UPPER CASE which is terminated by either ".", "?", or "!".
Each word of the sentence is separated by a single blank space.
Perform the following taks:
(a) display the count of palindromic words in the sentence.
(b) Display the palindromic words in the sentence.
Example of palindromic words:
MADAM, ARORA, NOON
Test your program with the sample data and some random data:
Example 1
INPUT : MOM AND DAD ARE COMING AT NOON
OUTPUT : MOM DAD NOON
NUMBER OF PALINDROMIC WORDS : 3
Example 2
INPUT : HOW ARE YOU?
OUTPUT : NO PALINDROMIC WORDS
*/
/* ISC COMPUTER SCIENCE PRACTICAL,2013 */