Largest Number At Least Twice of Others in java

You are given an integer array nums where the largest integer is unique. Determine whether the largest element in the array is at least twice as much as every other number in the array. If it is, print the index of the largest element, or print - ...

Sum of natural numbers in java

For an integer N, your task is to calculate the sum of first N natural numbers. Input User Task: Since this will be a functional problem, you do not have to worry about input. You just have to complete the function NumberSum() which takes the intege ...

NUMBER OF DAYS in Java

Given the number of the month, your task is to calculate the number of days present in the particular month. Note:- Consider non-leap year User task: Since this is a functional problem you do not have to worry about the input. You just ha ...

Which angled triangle

Given the 3 sides of a triangle, find out whether it is acute-angled, right-angled, or obtuse-angled. You need to output 1 for acute, 2 for right-angled, and 3 for an obtuse-angled triangle. You can assume that the input values always form a tria ...

Leap Year

Given a year, find if it is a leap year. A Leap year is the year that is multiple of 4. But, multiples of 100 which are not multiples of 400 are not leap years. User Task: Input consists of the year value as an int. You need to print 1 in c ...

Fahrenheit to Celsius

Given a temperature F in Fahrenheit, your task is to convert it into Celsius using the following equation:- T(°c) = (T(°f) - 32)*5/9 Input User Task: You have to take an input F and then convert Fahrenheit To Celsius. Constraints:- -1 ...

BigLight

Gian and Suneo want their heights to be equal so they asked Doraemons help. Doraemon gave a big light to both of them but both big lights have different speeds of magnifying. Let us assume the big light given to Gian can increase the height of a per ...

Bubble Sort Problem

Consider the following version of Bubble Sort: for (int i = 0; i < n; i++) { for (int j = 0; j < n - 1; j++) { // Swap adjacent elements if they are in decreasing order if (a[j] > a[j + 1]) { swap(a ...