Section B Practice Questions
Section B Practice Questions
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.
6)WAP to input a number N and print the first N terms of Fibonacci and
Tribonacci series.
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).