Arjun Thakur has Published 1109 Articles

C++ program to Zoom digits of an integer

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

129 Views

In this program we will see how to zoom digits of an integer in C++. The Zooming means print the numbers using some other characters in bigger form. The logic is simple, but we have to create larger numbers one by one from 0 to 9.Example Code#include using namespace ... Read More

How to find string count of a particular id in a column using a MySQL query?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

115 Views

For this, use the CHAR_LENGTH() function in MySQL. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Subject longtext    ); Query OK, 0 rows affected (1.17 sec)Now you can insert some records in the table using insert ... Read More

Printing the correct number of decimal points with cout in C++

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

13K+ Views

Here we will see how to print some floating point numbers up to some pre-defined decimal places. In C++, we can use setprecision with the cout to do this word. This is present under the iomanip header file in C++.Example Code#include #include using namespace std; int main() { ... Read More

HTML max Attribute

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

277 Views

The max attribute of the element is used to set the maximum value for . Both min and max are used to set a range of value for input element with type number, date, datetime, range, etc. It introduced in HTML5.Let us now see an example to implement the ... Read More

Designated Initializers in C

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

664 Views

In C90 standard we have to initialize the arrays in the fixed order, like initialize index at position 0, 1, 2 and so on. From C99 standard, they have introduced designated initializing feature in C. Here we can initialize elements in random order. Initialization can be done using the array ... Read More

How to right-align a menu in the menu bar with Java?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

777 Views

Let’s say we added a menu to the MenuBar −JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic(KeyEvent.VK_F); menuBar.add(fileMenu);Add the glue component in between the menus to align some of them on the right, for example −menuBar.add(Box.createHorizontalGlue());The menu added after the usage of above method, would get right-aligned ... Read More

How to insert mm/dd/yyyy format dates in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

5K+ Views

For this, use STR_TO_DATE(). Following is the syntax −insert into yourTableName values(STR_TO_DATE(yourDateValue, yourFormatSpecifier));Let us first create a table −mysql> create table DemoTable    (    ShippingDate date    ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command : Here, we are inserting formatted ... Read More

How to check if a variable is NULL in C/C++?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

22K+ Views

In C or C++, there is no special method for comparing NULL values. We can use if statements to check whether a variable is null or not.Here we will see one program. We will try to open a file in read mode, that is not present in the system. So ... Read More

HTML target Attribute

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

592 Views

The target attribute of the element is used to set where the linked document will open. You can set the document to open in a new window, same frame, parent frame, etc.Following is the syntax −Here, _blank is used to open the linked document in new window or tab, _self ... Read More

I want to resize and position a JFrame in Java. How can I achieve that?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:26

614 Views

To resize and position JFrame, use the Dimensions class. Here, we have set the bounds for the frame −int width = 500; int height = 400; Dimension size = Toolkit.getDefaultToolkit().getScreenSize(); frame.setBounds((int) size.getWidth() - width, 0, width, height);The following is an example to resize and poisiton a frame −Examplepackage my; import ... Read More

Advertisements