Revathi Satya Kondra has Published 72 Articles

Why is it considered a bad practice to omit curly braces in C/C++?

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 11-Apr-2025 17:32:54

897 Views

In C/C++, omitting the curly braces assumes that only the first statement is the block and this leads to quite a few issues during debugging, as code is pretty tough to read and comprehend. Curly braces help us prevent errors and confusion, which also helps with the flow of the ... Read More

C++ Program to Print only Odd Numbered Levels of a Tree

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 11-Apr-2025 17:32:01

164 Views

In C++, to print the odd-numbered levels of a binary tree, the levels are numbered from the root as Level 1. The odd-numbered levels are Level 1, Level 3, and so on. This program prints the nodes present at these odd levels. It uses level-order traversal to process the tree ... Read More

How do I remove a particular element from an array in JavaScript

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 10-Feb-2025 11:16:54

911 Views

In JavaScript, Removing a particular element from an array refers to the process of deleting or filtering out a particular element from the array. so that a element is no longer exists within that array. The Arrays are the most commonly used data structures in JavaScript, allowing developers to store ... Read More

Converting seconds in years days hours and minutes in JavaScript

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 10-Feb-2025 11:11:08

2K+ Views

In this article, we create a function that takes in a number(num) which represents the number of seconds. So, it construct and return a string that contains information of years, days, hours and minutes contained in those seconds. Converting seconds into years, days, hours, and minutes in JavaScript involves breaking ... Read More

Converting array to phone number string in JavaScript

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 30-Jan-2025 17:48:53

1K+ Views

To convert an array to a phone number string in JavaScript can be done by formatting the array elements into the desired phone number pattern. Following are the steps to learn how to convert array to phone number string in Javascript − Ensure that the ... Read More

Converting any case to camelCase in JavaScript

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 30-Jan-2025 17:47:41

772 Views

In this article, we create a function that can take a string in any format. Such as normal case, snake case, pascal case or any other into camelCase in JavaScript. camelCase is a writing style where each word within a phrase is capitalized, except for the first word, and there ... Read More

Appending Suffix to Numbers in JavaScript

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 30-Jan-2025 17:44:57

1K+ Views

Appending suffixes to numbers in JavaScript is used to add ordinal indicators (like "st", "nd", "rd", and "th") to the end of a number to denote its position in a sequence. This is useful for displaying dates, rankings, or other numeric data. A custom function ... Read More

Filter array with filter() and includes() in JavaScript

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 28-Jan-2025 11:48:32

14K+ Views

In this article, using the filter() and includes() methods in JavaScript, we can filter an array based on the elements presence in another array or specific conditions. For suppose we have two arrays as array1 and array2. we want to filter array1 to include only the elements that are present ... Read More

Static methods vs Instance methods in Java

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 28-Jan-2025 11:39:41

2K+ Views

In Java, the behaviour of any variable or method is defined by the keyword used in front of its declaration. One of the non-access modifiers is static, which can be used with both methods and variables. The static methods are defined at the class level and can be accessed without ... Read More

Java Math subtractExact(long x, long y) method

Revathi Satya Kondra

Revathi Satya Kondra

Updated on 28-Jan-2025 11:39:30

400 Views

We will discuss the Java Math subtractExact(long x, long y) method in Java and understand its functionalities and working. The subtractExact()is an inbuilt function in the Java Math library. The function returns the difference between the two parameters passed as arguments in the function. The function returns an exception when the ... Read More