Nitya Raut

Nitya Raut

158 Articles Published

Articles by Nitya Raut

158 articles

Implement your own itoa() in C

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 2K+ Views

In this section we will see how to convert an integer number to a string.The logic is very simple. Here we will use the sprintf() function. This function is used to print some value or line into a string, but not in the console. This is the only difference between printf() and sprintf(). Here the first argument is the string buffer. where we want to save our data.Input: User will put some numeric value say 42Output: This program will return the string equivalent result of that number like “42”Algorithm:Step 1: Take a number as argument Step 2: Create an empty ...

Read More

Replace substring with another substring C++

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 2K+ Views

Here we will see how to replace substring with another substring. It replaces the portion of the string that begins at character pos and spans len characters.The structure of the replace function is like below:string& replace (size_t pos,  size_t len,  const string& str,  size_t subpos,  size_t sublen);The parameters are pos: It is an insertion point, str : It is a string object, len : It contains information about number of characters to erase.AlgorithmStep 1: Get the main string, and the string which will be replaced. And the match string Step 2: While the match string is present in the main string: Step 2.1: Replace it with the given ...

Read More

Create a StringBuffer object using a reference stored in a variable of type String in Java

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 314 Views

To create a StringBuffer Object, we use the following syntax −StringBuffer s=new StringBuffer();When we create a reference to an object, we use the assignment operator. For example, String s1 = ”hi”; String s2 = s1; // s2 is a reference of s1A program to illustrate the creation of a StringBuffer object using a reference stored in a variable of type String is given below −Examplepublic class Example {    public static void main(String args[]) {       String input = "hey";       String s1 = input; // creating a reference of the String       StringBuffer ...

Read More

Media object in Bootstrap

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 194 Views

Use the .media-object class in Bootstrap to set the media object −Example           Bootstrap Example                                          Lolcode Tutorial                                                                              Introduction                LOLCODE is an esoteric programming language inspired by the funny things on the Internet. It is designed to test the boundaries of programming language design.                                

Read More

Bootstrap alert-danger class

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 406 Views

The alert-danger class in Bootstrap is used to set danger action.You can try to run the following code to implement the alert-danger class in Bootstrap −Example           Bootstrap Example                                 This is danger action!    

Read More

Create a blue button (primary) with Bootstrap

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 327 Views

Use the .btn-primary class in Bootstrap to create a primary button in Bootstrap that is blue in color −Example           Bootstrap Example                                 Click below if you want to know the result:       Result    

Read More

Add a blue background color to simulate a pressed button in Bootstrap

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 225 Views

To add a blue background color to simulate a pressed button, use the primary button in Bootstrap as in the following code −Example           Bootstrap Example                                          Score          Result (2018)          Result (2017)          

Read More

Create a caret arrow icon that represents dropdown button with Bootstrap

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 2K+ Views

Use the .caret class in Bootstrap to create a caret arrow icon representing dropdown button.You can try to run the following code to create a carot arrow icon −Example           Bootstrap Example                                          Brands          The car brands:                       Car                            BMW                Toyota                Audi                Mahindra                Volvo                                

Read More

Usage of CSS align-items property flex-start value

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 201 Views

Use the align-items property with value flex-start to align flex items on the top.ExampleYou can try to run the following code to implement the flex-start value −                    .mycontainer {             display: flex;             height: 300px;             background-color: red;             align-items: flex-start;          }          .mycontainer > div {             background-color: orange;             text-align: center;             line-height: 60px;             font-size: 30px;             width: 100px;             margin: 5px;          }                     Quiz                Q1          Q2          Q3          Q4          

Read More

Create a disabled look of a button with CSS

Nitya Raut
Nitya Raut
Updated on 11-Mar-2026 435 Views

To create a disabled button look, use the CSS opacity property.ExampleYou can try to run the following code to create a disabled look of a button −                    .btn1 {             color: black;             text-align: center;             font-size: 15px;          }          .btn2 {             color: black;             text-align: center;             font-size: 15px;             opacity: 0.5;          }                     Result       Click below for result:       Enabled       Disabled    

Read More
Showing 1–10 of 158 articles
« Prev 1 2 3 4 5 16 Next »
Advertisements