Comp Note
Comp Note
happy no
Piglatin no
Bin to dec
Fib rec
Niven
Mobius
Sq mat
Lucky no
snowball
fascinating
smith
Shuffle the matrix(2D)(1st row becomes the last, 2nd row becomes the 1st & so on..)
— by object
A class Composite contains a two dimensional array of order [m x n]. The maximum
value possible for both ‘m’ and ‘n’ is 20. Design a class Composite to fill the
array with the first (m x n)composite numbers in column wise. The details of the
members of the class are given below:
[Class name: CompositeData members/instance variables:
arr[ ] [ ] : stores the composite numbers column wiseM : integer to store the
number of rows N : integer to store the number of columns
Member functions/methods:
Composite(int mm, int nn ) : to initialize the size of the matrix m=mm and n=nnint
isComposite( int p ) : returns 1 if number is composite otherwise returns 0void
fill ( ) : to fill the elements of the array with the first (m × n)composite
numbers in column wisevoid display( ):displays the array in a matrix formSpecify
the class
Composite giving details of the constructor(int,int), int isComposite(int),
voidfill( ) andv oid display( ). Define a main( ) function to create an object and
call the functionsaccordingly to enable the task.
Design a program to accept a day number (between 1 and 366), year (in 4 digits)
from the user to generate and display the corresponding date. Also, accept N (1 <=
N <= 100) from the user to compute and display the future date corresponding to ‘N’
days after the generated date. Display an error message if the value of the day
number, year and N are not within the limit or not according to the condition
specified.
A Circular Prime is a prime number that remains prime under cyclic shifts of its
digits. When the leftmost digit is removed and replaced at the end of the remaining
string of digits, the generated number is still prime. The process is repeated
until the original number is reached again.
A number is said to be prime if it has only two factors 1 and itself. Accept a
positive number N and check whether it is a circular prime or not. The new numbers
formed after the shifting of the digits should also be displayed.A number is said
to be prime if it has only two factors 1 and itself.
A palindrome is a word that may be read the same way in either direction.
Accept a sentence in uppercase which is terminated by either “.”, “?” or “!”. Each
word of the sentence is separated by a single blank space.