How to Return the Closest Number Multiple of 10 in C
The challenge
Given a number return the closest number to it that is divisible by 10.
Example input:
22
25
37
Expected output:
20
30
40
In-depth guides, insights, and best practices for modern software engineering
Given a number return the closest number to it that is divisible by 10.
Example input:
22
25
37
Expected output:
20
30
40
Reverse every other word in a given string, then return the string. Throw away any leading or trailing whitespace, while ensuring there …
Read Article →Two red beads are placed between every two blue beads. There are N blue beads. After looking at the arrangement below work out the …
Read Article →Introduction
Welcome Adventurer. Your aim is to navigate the maze and reach the finish point without touching any walls. Doing so will …Read Article →
The number 89 is the first integer with more than one digit that fulfills the property partially introduced in the title of this …
You need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other …
Read Article →Task
King Arthur and his knights are having a New Years party. Last year Lancelot was jealous of Arthur, because Arthur had a date and …
Read Article →Build a pyramid-shaped tower, as an array/list of strings, given a positive integer number of floors. A tower block is represented with …
A number m of the form 10x + y is divisible by 7 if and only if x − 2y is divisible by 7. In other words, subtract twice the last digit …
Read Article →The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form …
Read Article →Master the art of distributing traffic efficiently across multiple servers and services in distributed architectures.
This program tests the life of an evaporator containing a gas.
We know the content of the evaporator (content in ml), the percentage of …
Read Article →Create a function named divisors/Divisors that takes an integer n > 1 and returns an array with all of the integer’s …
Terraform state is both the most critical and most dangerous aspect of infrastructure as code. It’s your source of truth for what exists, but …
Read Article →If a = 1, b = 2, c = 3 ... z = 26
Then l + o + v + e = 54
and f + r + i + e + n + d + s + h + i + p = 108
So friendship is twice as …
Infrastructure code needs the same quality assurance practices as application code, but testing infrastructure presents unique challenges. How do you …
Read Article →A child is playing with a ball on the nth floor of a tall building. The height of this floor, h, is known.
He drops the ball out of the …
Read Article →Instructions
Write a function that takes a single string (word) as argument. The function must return an ordered list containing the …
AWS CLIStep 1
export bucketname='your-bucket-here'
Step 2
aws s3api delete-objects --bucket $bucketname --delete "$(aws …
Read Article →
If you are creating a FSx file system, and want to connect it to AWS Managed Active Directory, then you will need to create a VPC Security Group with …
Read Article →Multi-cloud strategies are becoming increasingly common as organizations seek to avoid vendor lock-in, leverage best-of-breed services, and meet …
Read Article →If you need to calculate variance in Python, then you can do the following.
variance() from Statistics moduleimport statistics
list …
Read Article →
If you need to calculate and get the sum of a list in Python, then you can do the following.
sum()myList = [1, 2, 3, 4, 5, 6, 7, 8, …
Read Article →
If you need to add a list to a set in Python, then you can do the following:
Tuplemyset = set((1,2,3,4))
mylist = list(1,2,3]) …
Read Article →