Skip to content

sambathkumarj/100-days-of-coding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

100-days-of-coding

1 Write a program that takes three numbers and prints their sum. Every number is given on a separate line.

2 Write a program that reads the length of the base and the height of a right-angled triangle and prints the area. Every number is given on a separate line.

3 Write a program that greets the user by printing the word "Hello", a comma, the name of the user and an exclamation mark after it. See the examples below.

4 Write a program that reads an integer number and prints its previous and next numbers. See the example below.

5 N students take K apples and distribute them among each other evenly. The remaining (the indivisible) part remains in the basket. How many apples will each single student get? How many apples will remain in the basket? The program reads the numbers N and K. It should print the two answers for the questions above.

6 Given the integer N - the number of seconds that is passed since midnight - how many full hours and full minutes are passed since midnight? The program should print two numbers: the number of hours (between 0 and 23) and the number of minutes (between 0 and 1339). For example, if N = 3900, then 3900 seconds have passed since midnight. Therefore, the time now is 1:05am. So the program should print 1 65 - 1 full hour is passed since midnight, 65 full minutes passed since midnight.

7 Given two timestamps of the same day: a number of hours, minutes and seconds for both of the timestamps. The moment of the first timestamp happened before the moment of the second one. Calculate how many seconds passed between them.

8 Write a program to calculate the distance between two points. To find the distance between two points (x1,y1) and (x2,y2), all that you need to do is use the coordinates of these ordered pairs and apply some common sense. Begin with the most simplest formula and then incrementally arrive at the correct formula as you solve the test cases.

9 Given a three-digit number. Find the sum of its digits

10 Given an integer, print "odd" if it's odd and print "even" otherwise.

11 Given the year number. You need to check if this year is a leap year. If it is, print LEAP, otherwise print COMMON. The rules in Gregorian calendar are as follows: a year is a leap year if its number is exactly divisible by 4 and is not exactly divisible by 100 a year is always a leap year if its number is exactly divisible by 400

12 Given a month - an integer from 1 to 12, print the number of days in it in the year 2017.

13 Given three integers, print the least of them.

14 Write a program that receives a number on the input. If the number is a multiple of 3, it prints "Jugs". Otherwise, it prints the number.

15 Write a program that receives a number on the input. If the number is a multiple of 3, it prints "Jugs". If the number is a multiple of 5, it prints "Mugs". If the number is a multiple of both 3 and 5, it prints "JugsMugs". Otherwise, it prints the number.

16 Digit in Number Read two inputs. The first input is a digit. The second input is a number. Is the digit present in the number? If yes, return True. If no, return False.

17 JugsMugsPugs Write a program that receives a number on the input. If the number is a multiple of 3, it prints "Jugs". If the number is a multiple of 5, it prints "Mugs". If the number is a multiple of 7, it prints "Pugs". If the number is a multiple of both 3 and 5, it prints "JugsMugs". If the number is a multiple of both 3 and 7, it prints "JugsPugs". If the number is a multiple of both 5 and 7, it prints "MugsPugs". If the number is a multiple of both 3, 5 and 7, it prints "JugsMugsPugs".

18 Write a program that receives a number on the input. If the number is a multiple of 3, it prints "Jugs". If the number is a multiple of 5, it prints "Mugs". If the number is a multiple of 7, it prints "Pugs". If the number is a multiple of both 3 and 5, it prints "JugsMugs". If the number is a multiple of both 3 and 7, it prints "JugsPugs". If the number is a multiple of both 5 and 7, it prints "MugsPugs". If the number is a multiple of both 3, 5 and 7, it prints "JugsMugsPugs".

19 Write a program that receives a number on the input. If the number is a multiple of 3, or it contains digit 3, it prints "Jugs". If the number is a multiple of 5, or it contains digit 5, it prints "Mugs". If the number is a multiple of 7, or it contains digit 7, it prints "Pugs". Otherwise, it prints the number.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published