Programs class 10th AI practical
Programs class 10th AI practical
Questions:
1. Write a program to take 3 digit number as input from user and print
unit place,ten’s place and hundred place number.
2. Check whether a number is even or odd. Number should be user
input.
3. Write a program to find the largest number out of the three
numbers input by the user.
4. Write a program to check whether the given character is an
uppercase letter or lowercase letter or digit or a special character.
Q.5 Check whether a number input by the user is a
prime number and display an appropriate message.
Q.6 Check if an input year is leap year or not.
Q.7 Write a program to print a multiplication table of a
entered number.
Enter number: 2
Table of 2 is:
2 X 1=2
2 X 2=4
2 X 3=6
.
.
2 X 10=20
Q.8 Find the factorial of a number provided by the user .Also
check that the number should not be a zero.
• Factorial of zero is 1
• Factorial of 5! = 5*4*3*2*1
• Output: 120
Q.9 Write a program to check whether a number input by user
is Armstrong or not.
An Armstrong number is a special kind of number in math. It's a
number that equals the sum of its digits, each raised to a power.
Ex:153, 370, 371 and 407 are the Armstrong numbers.
Q.10 Find the square and cube of sum of first five
natural numbers.
• 1+2+3+4+5 =15
• 15**2=225
• 15**3=3375
Q.11 Calculate the sum of the elements of a tuple:
sample_tuple(3,2,5,7,11,6)
Q.12 Write a program to generate the following pattern as per number
of lines entered by the user:
*
**
***
****
Q.13 Find the length of sample List=[11,24,35,17] using for loop.