Let us set a radix here as.// radix int r = 32;Include the radix here as a BigInteger constructor.BigInteger one = new BigInteger("vv", r);Now get its string representation −String strResult = one.toString(radix);The following is an example −Example Live Demoimport java.math.*; public class Demo { public static void main(String[] args) { // radix int r = 32; BigInteger one = new BigInteger("vv", r); String strResult = one.toString(r); System.out.println(strResult); } }Outputvv
Now let us see a program of Intel 8085 Microprocessor. This program will calculate the multiplication of two 16-bit numbers.Problem StatementWrite 8085 Assembly language program to multiply two 16-bit numbers stored at 8000H -8001H and 8002H - 8003H.DiscussionThis program takes the 16 bit data from memory location 8000H – 8001Hand 8002H – 8003H. The 32 bit results are stored at location 8050H– 8053H.Here we have tested with two 16 bit numbers. The results are as follows 1111H × 1111H = 01234321H 1C24H × 0752H = 00CDFF88HInputfirst inputAddressData......800011800111800211800311......second input AddressData......80002480011C800252800307......Flow DiagramProgramAddressHEXCodesLabelsMnemonicsCommentsF00031, 00, 20LXI SP, 2000H InitializeStack pointerF0032A, 00, ... Read More
Jonathan Swift, the famous satirist of English Literature, wrote 'The Battle of the Books' in 1697. It is a classic prose piece depicting the battle between Moderns and Ancients books using the allegorical example of A Spider and A Bee. The prose is a parody of heroic poetry along the lines of Samuel Butler's parody of battle in Hudibras.Description of Battle of Books by SwiftThe battle began when the Moderns, occupying the lower of the two tops of the hill Parnassus, grew furious over the Ancients on the higher one. The Moderns offered to exchange places so that they could ... Read More
The ftp_raw() function is used to sends raw command to the FTP server.Syntaxftp_raw(con, command)Parameterscon − The FTP connectioncommand − The command to executeReturnThe ftp_raw() function returns the server's response as an array of strings.ExampleThe following is an example −
The name of the specified file or directory can be obtained using the method java.io.File.getName(). The getName() returns the name of the file or the directory and it requires no parameters.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo { public static void main(String[] args) { File file = new File("C:" + File.separator + "JavaProgram" + File.separator, "demo1.txt"); System.out.println("File name: " + file.getName()); } }The output of the above program is as follows −OutputFile name: demo1.txtNow let us understand the above program.The name of the specified ... Read More
First, create a BigInteger.BigInteger val = new BigInteger("198");Let us convert it to Binary, with radix as 2.val.toString(2);Convert it to Octal, with radix as 8.val.toString(8);Convert it to HexaDecimal, with radix as 16.val.toString(16);The following is an example −Example Live Demoimport java.math.BigInteger; public class Main { public static void main(String[] args) { BigInteger val = new BigInteger("198"); System.out.println("Value: " + val); // binary System.out.println("Converted to Binary: " + val.toString(2)); // octal ... Read More
Reading enhances thinking and creativity and hence, it is very important to choose the right books that help in developing positive thoughts in your mind.Following are some of the best sellers in the world of books that are popularly read for the depth of their content:Sapiens- A Brief History of HumankindSapiens has become a popular book, especially among the entrepreneurs today. Yuval Noah Harari traces the journey of the evolution of man and his contribution along with different theories propagated by anthropologists. The depth of knowledge in this book is a commendable work and the journey of over 70, 000 ... Read More
First, use the getenv() method to get the environment variables −System.out.println("PATH = " + System.getenv("PATH"));Now, get the key and value. Loop through to get the list of environment variables −Map e = System.getenv(); for (Iterator i = e.entrySet().iterator(); i.hasNext();) { Map.Entry mapEntry = (Map.Entry) i.next(); System.out.println(mapEntry.getKey() + " = " + mapEntry.getValue()); }The following is an example to retrieve environment variables with Map Collection −Example Live Demoimport java.util.Iterator; import java.util.Map; public class Demo { public static void main(String args[]) { System.out.println("PATH = " + System.getenv("PATH")); ... Read More
The 8257 pins are described is given in the table below.Fig. Physical pin diagram of Intel 8257Fig: Functional pin diagram of Intel 82578257 is using a power of 5V.D7-0/A15-8For communicating with the processor there are 8 bidirectional data pins, when the processor is in active and the 8257 s active state it is in slave mode. When the processor remains in the HOLD state and 8257 behaves as the master, they are used to send out the Most Significant 8 bits of memory address.A3-0When the processor remains in active state and are used as address input pins of 8257. Hence ... Read More
Before getting into an example, we should know what is rating bar in android. Rating bar is a subclass of absSeekbar class in android. It is used to show the rating on view Group or window manager.This example demonstrates how to use the rating bar in android.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 following code to res/layout/activity_main.xml. In the above code, we have declared Rating bar and set numStars as 5 means ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP