javascript

Different ways to get the last character from a string in JavaScript

Different ways to get the last string character in JavaScript. We will learn three different ways in this post.

Read
python

Python numpy.random.choice method example

Python numpy random choice method example to generate a random sample from a given 1-D array. We will use numpy.random.choice method.

Read
javascript

How to find the absolute value of a number in JavaScript

JavaScript program to find the absolute value of a number. We will use abs method of Math object to find the absolute value of a given number.

Read
javascript

How to check if a variable is undefined or null in JavaScript

JavaScript program to check if a variable is undefined or null. If we create one variable and don't assign any value to it, JavaScript assigns undefined.

Read
C++

C++ program to convert 12 hours to 24 hours time format

C++ program to convert 12 hours to 24 hours time format. This program will take hours, minutes and seconds values as the inputs from the user in 12 hours and convert it to 24 hours format.

Read
C++

C++ setfill method example

C++ setfill method explanation with example. setfill is defined in *iomanip* header and this method is used to set a fill character for a stream in C++.

Read
C++

How to swap two numbers using pointer in C++

C++ program to swap or exchange two numbers using pointers. This program will take the numbers as inputs from the user, swap them with pointers and print the swapped values.

Read
C++

C++ setw function explanation with example

C++ setw function explanation with example. setw function is used to set the field width for any output operation.

Read
python

How to convert a tuple to set in Python

Python program to convert a tuple to set. We will learn two different examples on tuple to set conversion in python.

Read
python

How to take Hexadecimal numbers as input in Python

Python program to take hexadecimal values as user inputs in python. Hexadecimal is base 16 number system.

Read