fabs function in C with example

The fabs function is defined in math.h header file. It is used to find out the absolute value of a number. fabs takes one double number as argument and returns the absolute value of that number. In this tutorial , we will show you how to use fabs function in C with examples.

Read

MongoDB : Insert one single document to a collection

For inserting one document to a collection in MongoDB, we can use insertOne() method. It has the following syntax :.

Read

Insert multiple documents to a MongoDB collection using insertMany

insertMany() was introduced in MongoDB version 3.2. Using this method, we can insert multiple documents to a collection easily. It has the below syntax :.

Read

Trim leading whitespace characters using trimMargin in Kotlin

Kotlin comes with a really handy function for string to trim leading whitespace characters easily. Known as trimMargin(), the definition of the function is as below :.

Read

3 different ways in Javascript to find if a string contains a substring or not

Finding out if a substring exists in a string or not is required in most development projects. There are a couple of different ways to check this in JavaScript. In this tutorial, we will learn three different ways in Javascript to find if a substring exists in a String or not. or not

Read

How to drop a collection in MongoDB

Dropping a collection will remove it from the database. It will also remove any index associated with the dropped collection. It also removes all indexes associated with the dropped collection. This method will obtain a write lock on the database. It will block all other operations till the drop is completed.

Read

Kotlin String template : Explanation with Examples

String is a sequence of characters. All strings are of String class. For example, "Hello World" is a string. One more important thing is that String is immutable in Kotlin, i.e. you cann't change any character of a string variable. Kotlin has introduced one new concept for string called string template. It allows us to include one variable or expression to a string. In this tutorial, we will show you how string template works in kotlin with different examples.

Read

Media objects in Bootstrap : Explanation with example

Media objects are used to create repetive contents with a media like image or videos. Think about a list of blog comments where user image is placed on the left side of the comment. We can easily create components like comments using media objects.Two classes are required for creating a media object.

Read

Kotlin program to reverse an array ( 2 different ways )

In this kotlin programming tutorial, we will learn how to reverse an array using two different ways - Reverse the array, assign this new array to a different variable and reverse an array in place. We are showing these examples for integer arrays, but you can use them for any other arrays with different data types. Let's take a look at the programs.

Read

Kotlin example program to find out the largest element in an array

In this Kotlin example program, we will learn how to find out the largest element in an array of numbers. This is a simple example program that will show you how to find out the largest number in an array. Let's take a look at the program :.

Read