Practical Work Class 11th
Practical Work Class 11th
Instructions:
Cover your file white paper with all your details in a box.
Students need to write sequentially the algorithm of each program,
then printout of the source code(put comments in your
program)and followed by the printout of output screen.
***********
*********
*******
*****
***
*
Q3. WAP to print the following format:
1010101
010101
10101
0101
101
01
1
Happy number: Starting with any positive integer, replace the number by the
sum of the squares of its digits, and repeat the process until the number equals
1.
Q5. Accept numbers into an integer array A of size 4, create another string
array B of size 3. Accept any three mathematical symbols like (+, -, *, /) in
array B. Then according to mathematical symbol calculate the answer.
For e.g. if A = [8, 6, 4, 2] & B = [+, -, *], then answer will be (((8 + 6) - 4) *
2) = 20.
Q6. WAP in java to enter a number and check whether the number is
Kaprekar number or not.
A Karprekar number for a given base is a non-negative integer, the
representation of whose square in that base can be split into two parts that
add up to the original number again. For e.g. 45 is a Karprekar number,
because 45 * 45= 2025 and 20 + 25 =
45.
Q7. Write a program for converting a sentence in reverse.
For e.g.: Input: JAVA IS PROGRAMMING Output: PROGRAMMING IS JAVA