Arjun Thakur has Published 1025 Articles

C++ Program to Find Factorial of a Number using Recursion

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 09:42:22

15K+ Views

Factorial of a non-negative integer n is the product of all the positive integers that are less than or equal to n.For example: The factorial of 4 is 24.4! = 4 * 3 * 2 *1 4! = 24The factorial of an integer can be found using a recursive program ... Read More

How do we add a push button to HTML?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 08:44:50

3K+ Views

Use the tag in HTML to add a push button. The HTML tag is used for creating a button within HTML form. You can also use tag to create similar buttons.The following are the attributes of the tag −AttributeValueDescriptionautofocusAutofocusSpecifies that the button should have input focus ... Read More

Fade in on Button hover with CSS

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 08:31:03

814 Views

You can try to run the following code to fade in on button hover with CSSExampleLive Demo                    .btn {             background-color: orange;             color: white;             padding: 10px;             text-align: center;             font-size: 16px;             margin: 5px;             opacity: 0.5;             transition: 0.5s;             display: inline-block;             text-decoration: none;             cursor: pointer;          }          .btn:hover {             opacity: 2          }                     Result    

Center an image with CSS

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 07:24:59

185 Views

To center an image, use the margin-left, margin-right and block CSS properties. You can try to run the following code to center an imageExampleLive Demo                    img {             border: 2px solid orange;             border-radius: 3px;             padding: 7px;          }          img {             display: block;             margin-left: auto;             margin-right: auto;             width: 50%;          }                        

Selects every

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 07:12:49

2K+ Views

Use the element ~ element selector to select elements preceded by element. You can try to run the following code to implement thisExampleLive Demo                    p~ul {             color: white;             background-color: blue;          }                     Demo Website       Fruits                Vegetables are good for health.                       Spinach             Onion             Capsicum                       Fruits are good for health.                Apple          Orange          Kiwi          

Create a tooltip that appears when the user moves the mouse over an element with CSS

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:53:17

375 Views

You can try to run the following code to create a tooltip visible on mouse over. Use the visibility propertyExampleLive demo           #mytooltip #mytext {          visibility: hidden;          width: 100px;          background-color: black;     ... Read More

Why is [1,2] + [3,4] = “1,23,4” in JavaScript?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:41:33

100 Views

The JavaScript's + operator is used to add two numbers or join two strings. However, use the contact() method to join two arrays to get a new one. For example, [50, 70].concat([90, 100])The above prints, [50, 70, 90, 100]Let’s see your example. The + operator concats strings, and converts the ... Read More

How to convert the image into a base64 string using JavaScript?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:36:26

604 Views

To convert the image into a base64 string using JavaScript, use the FileReader API. You can try to run the following code to get base64string for an image −Example                    function toDataURL(url, callback) {             ... Read More

Set a CSS style for the element when the animation is not playing

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:35:03

116 Views

Use the animation-fill-mode property to set a style for the element when the animation is not playingExampleLive Demo                    div {             width: 150px;             height: 200px;             position: relative;             background: red;             animation-name: myanim;             animation-duration: 2s;             animation-fill-mode: backwards;          }          @keyframes myanim {             from {left: 0px; background-color: green;}             to {left: 200px; background-color: blue;}          }                        

How do I print a double value with full precision using cout in C++?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 06:34:50

2K+ Views

The output stream cout allows using manipulators that you can use to set the precision directly on cout and use the fixed format specifier. To get the full precision of a double, you can use the limits library. For example, Example#include #include using namespace std; int main() {   ... Read More

Advertisements