Ram is given a positive integer N. He wishes to convert this integer into a single numeral . He does so by repeatedly adding the numerals of the number until there is only a single numeral . Help Ram by providing the single - numeral number finally obtained .
Input
The input is a single line containing a positive integer N.
Output
The output should be a single line containing a single-numeral number.
Explanation
In the example, the given number is 545.
As the number is more than a single numeral, repeatedly add the numerals like
5 + 4 + 5 => 14
1 + 4 => 5
So, the output should be 5.
Sample Input 1
545
Sample output 1
5
Sample Input 2
111
Sample output 2
3
Write a C++ program that accepts marks of five students and then displays their average. The program should not accept mark which is less than 0 and mark greater than 100.
Write a BMI calculator program using loop control, user-defined functions include list, arithmetic and decision control statements with the following conditions :
1) Prompt user to enter the weight in kilogram and height in metres up to 2 decimal places
2) Use the given formula to calculate the Body Mass Index (BMI) and round it to 2 decimal place
BMI = Weight / Height?
3) Create two data list namely, "name list" to store the username and the "bmi list" to store the calculated BMI respectively.
4) With the given BMI category, the program code is able to display the following:
a) Allow user to enter name, weight and height.
b) The username, the BMI value and the category that it falls into.
c) The usernames in the name list and the respective BMI values in the bmi_list.
BMI category are as follows
Less than 18.5
Underweight
18.5 to 24.9
Normal
25 to 29.9
Overweight
30 to 34.9
Obese class
35 to 39.9
Obese class Il
40 to 49.9
Morbid Obese
50 or greater
Obese class IlI
A company is offering a special discount to its customers based on an algorithm. Two range values are fed to the algorithm and in return t will calculate the discount to offer to the customers. The discount is calculated as the sum of all the prime numbers within the defined range including the range values if the range values are the prime numbers
Write an algorithm to find the special discount given to the customers
Input
The first line of the input consists of
an integer-rangelet remeng
the minimum boundary wabererte
given range finding the p
values)
A company is offering a special discount to its customers based on an algorithm. Two range values are fed to the algorithm and in return t will calculate the discount to offer to the customers. The discount is calculated as the sum of all the prime numbers within the defined range including the range values if the range values are the prime numbers
Write an algorithm to find the special discount given to the customers
Input
The first line of the input consists of
an integer-rangelet remeng
the minimum boundary wabererte
given range finding the p
values)
Develop a python code to accept two numbers from the user to check whether those number
are divisible by both 3 and 5 or not .
Rotating alphabet T by 360 degrees in clockwise direction in java
Write a shell script to reverse a number supplied by a user.
rotating alphabet T by 360 degrees in clockwise direction in C++
Create a program that will compute the basic salary of the employee, the daily rate of the employee is 80 pesos per hour the regular daily hours of the employee is 8 hours. Compute the total net gross of the employee in 22 days with the following deductions Pag-ibig = 150, SSS = 400, PhilHealth = 200.