Object Oriented Programming
Assignment-1
1. Define for-loop with syntax and write a program to print(alphabet
letter) A star pattern.
Input:A
Output:
**
* *
******
* *
2. Given an array of positive integers arr[] of size n,the task is to find
second largest distinct element in th array.
Note: If the second largest element does not exists,return-1.
Examples:
Input: arr[] = [12.35,1,10,34,1]
Output: 34
Explaination: The largest element of the array is 35 and the second largest
element is 34.
3. Calculating the sum of Numbers from 1 to 10 with java while loop.
[Link] number of digits in a number using do- while.
Input:5678
Output:4
[Link] whether the given number is divisible by both 5 and 10.
Input 1:20
Output:True
Input 2: 25
Output:False