George John has Published 1081 Articles

How to set the minimum number of lines for an element that must be visible at the top of a page in JavaScript?

George John

George John

Updated on 23-Jun-2020 13:02:06

146 Views

Use the orphans property in JavaScript to set the minimum number of lines for an element that must be visible at the top of a page. You can try to run the following code to learn how to implement orphans property −document.getElementById("p").style.orphansThis is how you can return the orphans property −var ... Read More

How do I clear the usage of setInterval()?

George John

George John

Updated on 23-Jun-2020 12:58:39

196 Views

The setInterval() method is used evaluate an expression at specified intervals. This function calls function after every duration milliseconds. This goes for unlimited times. Let’s see an example −It triggers alert(‘Hello’) after every 2000 milliseconds, not only once.setInterval(function() { alert('Hello');}, 2000);To clear the usage of setInterval(), use the window.clearInterval() and set ... Read More

How to use the GetLongLength method of array class in C#?

George John

George John

Updated on 23-Jun-2020 12:47:19

340 Views

The GetLongLength method in C# gets a 64-bit integer that represents the number of elements in the specified dimension of the Array.First, set the array.long[, ] arr2= new long[15, 35];For a specified dimension of the array, set the index in the GetLongMethod() method like −long len2 = arr2.GetLongLength(0);Let us see ... Read More

How to use the Main() method in C#?

George John

George John

Updated on 23-Jun-2020 12:41:09

790 Views

A main method is static since it is available to run when the C# program starts. It is the entry point of the program and runs without even creating an instance of the class.The Main method states what the class does when executed and instantiates other objects and variables.The following ... Read More

What are abstract properties in C#?

George John

George John

Updated on 23-Jun-2020 12:22:10

942 Views

An implementation of the property accessors will not be provided by an abstract property declaration.Let us see how to learn how to work with abstract properties. Here we have an abstract class Shape with two derived classes: Square and Circle.Here, we have an abstract Area property.The following is the Circle ... Read More

How to find maximum between 2 numbers using C#?

George John

George John

Updated on 23-Jun-2020 12:12:53

1K+ Views

Firstly, declare and initialize two numbers.int num1 = 50; int num2 = 90;With that, use if-else to find the maximum number.if (num1 > num2) {    maxNum = num1; } else {    maxNum = num2; }Above, we have set the maximum value to the variable maxNum and printed it ... Read More

How to create nested while loop in C#?

George John

George John

Updated on 23-Jun-2020 12:06:18

366 Views

For a nested while loop, we have two while loops.The first loop checks for a condition and if the condition is true, it goes to the inner loop i.e. the nested loop.Loop 1while (a

Difference between Method and Function in C#

George John

George John

Updated on 23-Jun-2020 11:40:18

6K+ Views

Methods and Functions are the same in C#.However, Methods are used in C# and are functions that operate through a designated class. A method is a group of statements that together perform a task. Every C# program has at least one class with a method named Main.The following is a ... Read More

C# program to determine if a string has all unique characters

George John

George John

Updated on 23-Jun-2020 11:34:36

3K+ Views

Use the substring() method in C# to check each and every substring for unique characters. Loop it until the length of the string.If any one the substring matches another, then it would mean that the string do not have unique characters.You can try to run the following code to determine ... Read More

Delete nth element from headnode using C#

George John

George John

Updated on 23-Jun-2020 11:22:41

155 Views

Firstly, set a link list and add some elements.Demo list = new Demo(); list.Push(50); list.Push(100); list.Push(150);Now to delete nth element from headnode, pass what you want to delete. If you will set 1, then it will delete the head node.Exampleif (val == 1) {    head = head.Next;    return; ... Read More

Advertisements