0% found this document useful (0 votes)
8 views

Computer_Assignments_X_SET-2

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)
8 views

Computer_Assignments_X_SET-2

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

SACRED HEART SCHOOL, ADRA-2024-25

Assignments

Set-2

Std: X Subject: Computer Date:24.09.2024

Q1. WAP using a method palin(), to check whether a string is a palindrome or


not.(use InputStreamReader to take input).

Q2.Write a program in java to accept a name(containing three words) and


display only the initials(i.e., first letter of each word).

Q3. Write a program in java to enter a String/Sentence and display the longest
word and the length of the longest word present in the string.

Q4. Write a program using method name Glcm(int, int) to find the lowest
common Multiple(LCM) of two numbers. GCD of two integers is calculated by
continued division method. Divide the larger number by the smaller, the
remainder then divides the previous divisor. The process is repeated till the
remainder is zero. The divisor then results in the GCD.
LCM=product of two numbers/GCD

Q5.Write a program to a accept a list of 20 integers and sort the array in


ascending order using selection sort technique.

Q6. Write a menu driven program to generate the upper case letters from Z to A
and lower case letters from ‘a’ to ‘z’ as per user’s choice. Enter ‘1’ to display
upper case letters from Z to A and enter ‘2’ to display lower case letters from a
to z.

Q7.Write a program to input and store roll numbers, names and marks in 3
subjects of n number of students in five single dimensional arrays and display
the remark based on average marks as given below:
Average Marks Remark
85-100 Excellent
75-84 Distinction
60-74 First Class
40-59 Pass
Less than 40 Poor

Q8. Write a program to input two numbers and check whether they are twin
prime numbers or not.
Hint: Twin prime numbers are the prime numbers whose difference is 2.
For example: (5,7),(11,13)…. and so on…

Q9. Write a program to display all the numbers between 100 and 200
which don’t contain zeros at any position.

Q10. Write a program to input a number. Display the product of the


successors of even digits of the number entered by user.
Input:2745
Output: 15
[Hint: The even digits are: 2 and 4. The product of successor of even
digits is 3*5=15].

*****************************************************************************

You might also like