C++

C++ program to find the first and the last digit of a number

In this C++ tutorial, we will learn how to find the first and the last digit of a user given number. For example, if the number is 12459, it will print 9 as the last number and 1 as the first number. Our program will take the number as an input from the user and print out the result.

Read
kotlin

Kotlin example to use aggregate with groupingBy

groupingBy method is used to group items of a collection using a keySelector function. It returns one Grouping object. For example, we can group a list of strings by the first character of each string. aggregate is another function that can be used with a Grouping to apply one operation on each element of each group sequentially. In this post, I will show you how to use groupingBy with one example.

Read
javascript

JavaScript program to open one url in a new tab

The anchor tag is used in HTML to open one new link in a new page. You can use this tag if you have a static URL. But, sometimes, we may need to do it dynamically as if the user clicks on a button, we will open one link in a new tab. We need JavaScript for that. JavaScript provides one method called window.open() that can be used to open a link in a new browser tab.

Read
javascript

How to change HTML page using JavaScript

You can add one piece of JavaScript code with a HTML page to change or modify HTML and CSS values dynamically. HTML is a markup language that is used to define the structure of a page, CSS is style rules used to add styles to a HTML page and JavaScript is a scripting programming language that is used to add complex dynamic features to a HTML page like responding to different user interactions, changing the web page dynamically, animate the page, etc. Without JavaScript, your web page will be a static page.

Read
c

C program to check if a character is white-space or not

In this post, I will show you how to check if a character is white-space or not using isspace function. A white-space character can be a space(' '), horizontal tab('\t'), newline('\n'), vertical tab('\v'), feed('\f') or carriage return('\r'). We will use isspace() function to check that. This function is defined is ctype header file.

Read
c

C toUpper() method explanation with example

toUpper is defined in Ctype.h header file. It is used to convert one lowercase letter to the uppercase. If the conversion is not possible, it returns the same letter. As it is defined in Ctype.h, we need to import this header in our program.

Read
C++

5 different C++ programs to print one string without a semicolon

In this post, I will show you how we can print one string without semicolon in C++. In C++, we need to end one statement with a semicolon to complete it. But there are ways to execute one statement without a semicolon.

Read
kotlin

What is JvmStatic annotation in Kotlin and why we use it

JvmStatic annotation or @JvmStatic is an important annotation of Kotlin. In this post, I will show you where JvmStatic is used and its use cases.

Read
kotlin

Kotlin groupingBy explanation with example

groupingBy function is used to group items and apply one operation using a keySelector function. It returns one Grouping object that we can use to call its other methods. In this post, I will quickly show you how to use groupingBy with examples.

Read
kotlin

Kotlin groupByTo method explanation with examples

groupByTo method is used to group elements of an array by a key returned by a key selector function. It is similar to groupBy. The only difference is that we can put the result in a mutable map.

Read