0% found this document useful (0 votes)
6 views7 pages

Section B Practice Questions

The document contains a list of programming exercises focused on loop-based programs and important Java programs. It includes tasks such as checking for various types of numbers (amicable, spy, perfect, etc.), calculating HCF and LCM, and creating menu-based programs for geometric calculations and number series. Additionally, it provides examples of pattern printing and string manipulation in Java.

Uploaded by

kunalkhemka2127
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)
6 views7 pages

Section B Practice Questions

The document contains a list of programming exercises focused on loop-based programs and important Java programs. It includes tasks such as checking for various types of numbers (amicable, spy, perfect, etc.), calculating HCF and LCM, and creating menu-based programs for geometric calculations and number series. Additionally, it provides examples of pattern printing and string manipulation in Java.

Uploaded by

kunalkhemka2127
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/ 7

SECTION B PRACTICE QUESTIONS

LOOP BASED PROGRAMS


1)WAP to input 2 numbers and check if they are amicable number.
2)WAP to input a number and check if it is a spy number.
3)WAP to input a number and check if it is a perfect number.
4)WAP to input a number and check if it is a special number.
5)WAP to input a number and check if it is a happy number.
6)WAP to input a number and check if it is an ugly number.
7)WAP to input a number and check if it is a kaprikar number.
8)WAP to input a number and check if it is a mercini number.
9)WAP to input a number and check if it is a Niven number.
10)WAP to input a number and check if it is a tech number.
11)WAP to input a number and check if it is a palindrome
number.
12)WAP to input a number and check if it is a prime palindrome number.
13)WAP to input a number and check if it is an armstrong number.
14)WAP to input a number and check if it is a pronic number.
15)WAP to input a number and check if it is a co prime number.
16)WAP to input a number and check if it is a duck number.
17)WAP to input a number and check if it is a buzz number.
18)WAP to input a number and check if it is a dudeny number.
19)WAP to input a number and check if it is an automorphic number.
20)WAP to input a number and check if it is a disarium number.
21)WAP to input a number and check if it is a twisted prime number.
22)WAP to input a number and check if it is a magic number.
SOME IMPORTANT JAVA PROGRAMS

1)Write a program(WAP) to input a number and find HCF and LCM of that
number.

2)WAP to input two numbers and swap them without using a third variable.

3)WAP to input a year and check if it is a leap year or not.

4)Write a menu based program to print 1.area of square,2.area of


rectangle,3.area of circle,4.area of triangle,5.volume cube and cuboid,6.surface
area of cylinder according to the choice of user.

5)WAP to input a number and check whether it is even or odd, positive or


negative, Display "FULL MARKS" if number is odd and negative.

6)WAP to input a number N and print the first N terms of Fibonacci and
Tribonacci series.

7)Write a menu based program to print this according to choice of user

A) 1
12
123
1234
12345
B)1 2 3 4 5
1234
123
12
1

C)1
22
333
4444
55555

D)5 4 3 2 1
5432
543
54
5

E) 1
21
321
4321
54321
Q8)Write a menu based program to print these according to choice of user:-
A)#
##
###
####
#####

B)#####
####
###
##
#

C) #
##
###
####

D) #
##
###
####
#####
Q9)WAP to input a string "YASIR" and print it in this way:

Y
YA
YAS
YASI
YASIR
Q10) Write programs to display the following series:
i) 1, 3, 5, 7, 9, ... 29
ii) 2, 4, 6, 8, 10, ... 30
iii) 100, 90, 80, 70, 60, ... 0
iv) 1, 2, 4, 7, 11, 16, 22, 29, ... nth term. (Take n as input).
v) 2, 4, 8, 14, 22, 32, ... nth terms. (Taken n as input).

Q11)Write a program to find the sum of first 10 odd natural numbers.


Q12)Write a program to find the sum of all 3-digit even natural numbers.
Q13)DISPLAY THIS by WAP IN JAVA:
10101
01010
10101
01010
10101

Q14)Write a program to input a number and check whether it is a Smith number


or
not. Smith number is such a number the sum of whose digits equals the sum of
the
digits of its prime factors.
Smith number is a composite number in which the sum of its digits is equal to
the
sum of the digits of all its prime factors.
For example, 378 is a Smith number as the sum of the digits of 378 are: 3+7+8
= 18.
The prime factors of 378 are: 2, 3, 3, 3, 7 (sum = 2+3+3+3+7 = 18)

Join our whatsapp Group X notes


https://chat.whatsapp.com/KKHFIHE7QMQEp0nJd0hEbe

You might also like