Chandu yadav has Published 802 Articles

Check if a large number is divisible by 11 or not in java

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 12:03:01

2K+ Views

A number is divisible by 11 if the difference between the sum of its alternative digits is divisible by 11.i.e. if (sum of odd digits) – ( sum of even digits) is 0 or divisible by 11 then the given number is divisible by 11.Programimport java.util.Scanner; public class DivisibleBy11 ... Read More

GCD and LCM of two numbers in Java

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 11:57:26

1K+ Views

Following is an example which computes find LCM and GCD of two given numbers.Programimport java.util.Scanner; public class LCM_GCD {    public static void lcm(int a, int b){       int max, step, lcm = 0;       if(a > b){          max = step = ... Read More

Perform Animation on border-right-width property

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 11:47:36

130 Views

To implement animation on border-right-width property with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 500px;             height: 300px;         ... Read More

Animated background with CSS

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 11:28:48

693 Views

Use the @keyframes to animate. To implement animation on background with CSS, you can try to run the following codeExampleLive Demo                    div {             width: 400px;             height: 300px;             animation: myanim 3s infinite;          }          @keyframes myanim {             30% {                background: green bottom right/50px 50px;             }          }                        

MySQL Mass Update with CASE WHEN/ THEN/ ELSE?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 11:20:23

10K+ Views

The syntax for mass update with CASE WHEN/ THEN/ ELSE is as follows −UPDATE yourTableName set yourColumnName=case when yourColumnName=Value1 then anyUpdatedValue1 when yourColumnName=Value2 then anyUpdatedValue2 when yourColumnName=Value3 then anyUpdatedValue3 when yourColumnName=Value4 then anyUpdatedValue4 else yourColumnName end;To understand the above syntax, let us first create a table. The query to create ... Read More

Fetching rows added in last hour with MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 11:16:36

6K+ Views

You can use date-sub() and now() function from MySQL to fetch the rows added in last hour.SyntaxThe syntax is as follows −select *from yourTableName where yourDateTimeColumnName create table LastHourRecords -> ( -> Id int, -> Name varchar(100), -> Login datetime -> ); Query OK, 0 rows affected (0.67 sec)Insert ... Read More

Get the time difference and convert it to hours in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 11:11:26

2K+ Views

You can achieve with the help of timestampdiff() method from MySQL. The syntax is as follows −SyntaxSELECT ABS(TIMESTAMPDIFF(HOUR, yourColumnName1, yourColumnName2)) as anyVariableName from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table DifferenceInHours    -> (   ... Read More

Set whether the text should be overridden to support multiple languages with CSS

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 10:23:25

137 Views

Use the unicode-bdi property to set whether the text should be overridden to support multiple languages with CSSExampleLive Demo                    p.demo1 {             direction: rtl;             unicode-bidi: bidi-override;          }          p.demo2 {             direction: rtl;             unicode-bidi: isolate;          }                     The unicode-bidi Property       This is demo text.       This is demo text       This is demo text    

How to close or hide the virtual keyboard on Android?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 10:17:36

5K+ Views

In Android there are some situations, we should close android default keyboard forcefully. For that this example is help for you.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the ... Read More

How to throw a C++ exception?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 10:15:04

296 Views

Exception handling is used to handle the exceptions. We can use try catch block to protect the code. Exception can be thrown anywhere within the code block. The keyword “throw” is used to throw an exception.Here is an example of throw in C++ language, Example Live Demo#include using namespace std; ... Read More

Advertisements