Articles on Trending Technologies

Technical articles with clear explanations and examples

Print first m multiples of n in C#

Samual Sam
Samual Sam
Updated on 11-Mar-2026 709 Views

To print m multiples of n, first set the value of m and n − int n = 6, m = 1; Now loop through the value of m, increment it and multiply with n on every iteration − while (m

Read More

How to store data in the browser with the HTML5 localStorage API?

Daniol Thomas
Daniol Thomas
Updated on 11-Mar-2026 282 Views

HTML5 localStorage saves string data in the browser and lasts beyond the current session. localStorage stores the data, with no expiration, whereas sessionStorage is limited to the session only. When the browser is closed, the session is lost.The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.You can try to run the following code to learn how to work with HTML5 localStorageExample     ...

Read More

How to use JavaScript to set cookies for homepage only?

Vrundesha Joshi
Vrundesha Joshi
Updated on 11-Mar-2026 366 Views

To set cookies for a homepage, add the page to the homepage itself.ExampleYou can try to run the following code to set cookies                                                  Enter name:                    

Read More

How to set all the border bottom properties in one declaration in JavaScript DOM?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 11-Mar-2026 188 Views

To set the border bottom properties in one declaration in JavaScript, use the borderBottom property. It allows you to set the border-bottom-width, border-bottom-style, and border-bottom-color.ExampleYou can try to run the following code to learn how to set border bottom properties −                    #box {             border: 2px dashed blue;             width: 120px;             height: 120px;          }                     Set border bottom color                Demo Text          Demo Text                      function display() {             document.getElementById("box").style.borderBottom = "thin dashed #000000";          }          

Read More

Java program to calculate mode in Java

Chandu yadav
Chandu yadav
Updated on 11-Mar-2026 16K+ Views

In statistics math, a mode is a value that occurs the highest numbers of time. For Example, assume a set of values 3, 5, 2, 7, 3. The mode of this value set is 3 as it appears more than any other number.Algorithm1.Take an integer set A of n values. 2.Count the occurrence of each integer value in A. 3.Display the value with the highest occurrence.Examplepublic class Mode {    static int mode(int a[], int n) {       int maxValue = 0, maxCount = 0, i, j;       for (i = 0; i < n; ...

Read More

Java Program to pass method call as arguments to another method

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 22K+ Views

In this article, we will understand how to pass method call as arguments to another method. We can call a method from another class by just creating an object of that class inside another class. After creating an object, call methods using the object reference variable.Below is a demonstration of the same −InputSuppose our input is −Enter two numbers : 2 and 3OutputThe desired output would be −The cube of the sum of two numbers is: 125AlgorithmStep 1 - START Step 2 - Declare two variables values namely my_input_1 and my_input_2 Step 3 - We define a function that takes ...

Read More

How can I display an image inside SVG circle in HTML5?

Anvi Jain
Anvi Jain
Updated on 11-Mar-2026 10K+ Views

To display an image inside SVG circle, use the element and set the clipping path. The element is used to define a clipping path. Image in SVG is set using the element.ExampleYou can try to run the following code to learn how to display an image inside SVG circle in HTML5           HTML5 SVG Image                                                                                              

Read More

Java program to calculate the average of numbers in Java

karthikeya Boyini
karthikeya Boyini
Updated on 11-Mar-2026 18K+ Views

An average of a set of numbers is their sum divided by their quantity. It can be defined as −average = sum of all values / number of valuesHere we shall learn how to programmatically calculate average.Algorithm1. Collect integer values in an array A of size N. 2. Add all values of A. 3. Divide the output of Step 2 with N. 4. Display the output of Step 3 as average.Examplepublic class AverageOfNNumbers {    public static void main(String args[]){       int i,total;       int a[] = {0,6,9,2,7};       int n = 5;       total = 0;       for(i=0; i

Read More

How to set all the border left properties in one declaration with JavaScript?

Sai Subramanyam
Sai Subramanyam
Updated on 11-Mar-2026 139 Views

To set all the border left properties in a single declaration, use the borderLeft property. You can try to run the following code to learn how to set the border left properties − Example Live Demo #box { border: thick solid gray; width: 300px; height: 200px } Demo Text Change left border function display() { document.getElementById("box").style.borderLeft = "thick solid #000000"; }

Read More

Check if a binary string contains all permutations of length k in C++

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Mar-2026 185 Views

Suppose we have a binary string, another integer k. We have to check the string is containing all permutations of binary of k bits. Suppose a string is like “11001”, and if the K = 2, then it must have all permutations of k bit numbers. (00, 01, 10, 11), the given string has all permutation. So this is valid string.by taking the binary string and the value of k, we have to check whether binary sequences are matched or not. The binary sequence is made of size k. So there will be 2k number of different binary permutations. We ...

Read More
Showing 271–280 of 61,248 articles
« Prev 1 26 27 28 29 30 6125 Next »
Advertisements