As a newbie programmer
As a newbie programmer

As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets


Ceil and Floor @ Dcoder

16 Apr 2023 1 minute read 0 comments Lochard

Problem: In mathematics and computer science, the floor and ceiling functions map a real number to the largest previous and the smallest following integer, respectively. consider a number x. ceil(x) : Returns the smallest integer that is greater than...

The Homework @ Dcoder

15 Apr 2023 1 minute read 0 comments Lochard

Problem: As the students were not focusing much on the lecture. The professor became very angry and decided to give a homework to all the students. So some of the students started trying to convince the professor not to do so. So the professor gives...

Least Significant Bit @ Dcoder

14 Apr 2023 1 minute read 0 comments Lochard

Title: Least Significant Bit Problem: In mathematics and digital electronics, a binary number is a number expressed in the base-2 numeric system or binary numeric system, which uses only two symbols: typically 0 (zero) and 1 (one). The least signific...

Text Editor @ Dcoder

13 Apr 2023 1 minute read 0 comments Lochard

Problem: John has created a text editor, which has lots of features but he forgot to add the conversion of Lowercase alphabet to an Uppercase Alphabet. He asks you for help to complete this task for him. Input: The first line of input consists of sin...

Valid Quadrilateral @ Dcoder

12 Apr 2023 1 minute read 0 comments Lochard

Problem: John loves gardening. He believes that for good growth of the plant, the land should be quadrilateral. Given angles of 4 sides of the land. Find whether the land is a valid quadrilateral or not. A quadrilateral is valid if the sum of all fou...

Archie and his Homework @ Dcoder

11 Apr 2023 1 minute read 0 comments Lochard

Problem: Archie was given a homework by his teacher. He is given a fraction and he needs to write it in its reduced form. Archie is not good at Maths. Help Archie finish his homework. Input: 2 integers separated by space denoting the numerator and de...

Numbered Triangle @ Dcoder

10 Apr 2023 1 minute read 0 comments Lochard

Title: Numbered Triangle Problem: You need to print this pattern upto N. For N = 4, 1 1 2 1 2 3 1 2 3 4 Input: A single positive integer N. Output: Numbered Triangle upto N. Do not leave trailing whitespaces at the end of each line. Constraints: 1 ≤...

Special Array @ Dcoder

9 Apr 2023 1 minute read 0 comments Lochard

Problem: Natural numbers are the set of positive integers, which ranges from 1 to infinity excluding fractional part. Natural numbers are whole numbers excluding zero. Zero is the only whole number which is not a natural number. An array is special i...

Pangram @ Dcoder

6 Apr 2023 1 minute read 0 comments Lochard

Problem: A word or a sentence is called a pangram if all the characters of this language appear in it at least once, either in lowercase or in uppercase. You are given a string S consisting of lowercase and uppercase English letters. If the string is...

Extraction of Numbers @ Dcoder

5 Apr 2023 1 minute read 0 comments Lochard

Problem: Ron is schizophrenic and sees random digits hidden in words. He thinks it means something and someone is trying to secretly communicate with him. He wants to extract those digits from the words and see if they form a message. Harry really wa...