Skip to main content

Java Program to convert decimal to binary number

import javax.swing.*;
 
class dec_bin{
    public static void main(String args[]){
        String inp, bin;
        int dec, x;
         
        inp = JOptionPane.showInputDialog("Enter a Decimal
    Number:");
        dec = Integer.parseInt(inp);
         
        bin = "";
        while(dec != 0){
            x = dec % 2;
            bin  = x + bin;
            dec /= 2;
        }
        System.out.println("Binary: " + bin);
    }
}

Comments

Popular posts from this blog

python program to Print Starting Series OF Indian Mobile Number for a State or operator or both

import requests import urllib.request import time from bs4 import BeautifulSoup as bs import re url = ' https://en.wikipedia.org/wiki/Mobile_telephone_numbering_in_India' state_to_extract = "UE" #if set to None all state is considered telecom_to_extracted = None #if set to none all operator from particular city is extracted response = requests . get(url) print (response) soup = bs(response . text, "html.parser" ) one_a_tag = soup . findAll( 'tr' )[ 35 :] lst = [] for k in one_a_tag: s = k . findAll( 'td' ) limit = len (s) i = 0 while True : if i == limit: break no = s[i] . text i += 1 if i == limit: break operator = s[i] . text i += 1 if i == limit: break state = s[i] . text i += 1 if i == limit: break res = f "{no} {operator} {state}" if state_to_extract is None : if telecom_to_extracted is None : lst . append(no) elif telecom_to_e...

13 websites to register your free domain

Register your Free Domain Now!! 1)  .tk Dot TK is a FREE domain registry for websites on the Internet. It has exactly the same power as other domain extensions, but it’s free! Because it’s free, millions of others have been using .TK domains since 2001 – which makes .TK powerful and very recognizable.  Your website will be like www.yourdomainname.tk . It is free for 1 year. It’s a ccTLD domain whixh having the abbreviation  Tokelau. To create a .tk domain, Visit   www.dot.tk 2) co.cc Co.cc is completely free domain which is mostly used by blogspot bloggers because of it’s easy to use DNS system. Creating a co.cc for blogger is simple ( for instructions- “click here”). Your website will be like www.yourdomainname.co.cc . To create a .co.cc domain, visit www.co.cc 3)   co.nr co.nr is too like co.cc. Your website will be like  www.yourdomainname.co.nr . You can add it for blogger also.. To create a .co.cc domain, vi...

How to Check Which Type of Processor Your Android Device Have?

#1 First of all download and install the app named Droid Hardware Info from the Google Play Store. Just search for this app and then click on the install button aside to it to start the installation process, after that let the app be downloaded and installed. Some permissions would be asked before you start to install the app just grant all those and move right away with the installation. #2 Open the newly installed app and inside the app head towards to the System tab and you would see there the two fields named CPU Architecture and Instruction Sets. Open up these fields and surf through these, you would get much much information regarded to the processor but you might not be able to read it as such. Just follow up the method and we would help you decode that information of your Android device processor. #3 Essentially the ARM: ARMv7 or armeabi, ARM64: AArch64 or arm64 and the x86: x86 or x86abi is the decoded information for your processor architecture that you might...

Dragon Age: Inquisition Digital Deluxe Edition + All DLCs (torrent) Repack Size: 20.1~23.9 GB

Brief : Dragon Age: Inquisition  is an  action role-playing video game  developed by  Bioware Edmonton  and published by  Electronic Arts . The third major game in the  Dragon Age  franchise,  Dragon Age: Inquisition  is the sequel to  Dragon Age: Origins  and  Dragon Age II . The game was released worldwide in November 2014 for  Microsoft Windows ,  PlayStation 3 ,  PlayStation 4 ,  Xbox 360 , and  Xbox One . Repack Size: 20.1~23.9 GB 

C++ Program to implement File Handling With Class Objects

Q32. Program to implement File Handling With Class Objects: Define a class to represent a bank account. Include the following members:   i) Depositor Name  ii) Account Number iii) Balance Amount Member Function   i) To Assign Initial values(opening balance Rs. 1000 by default)  ii) To deposit an amount iii) To withdraw an amount(if possible) iv) To display the current balance Write a file based program to store the records of at least ten accounts in “ACCOUNT_DETAIL” data file and perform the required manipulations- DEPOSIT, WITHDRAW & BAL_ENQUIRY using the file on a given account. The changes after each deposit and withdrawal should be updated in the given file. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 7...

get free domain for blogger

Get free domain for blogger 1.steps for Blogger= 1. type your blog address and your email id and using comment form 2. Goto your blog ,sign in and then goto layout{for modern interface}or Page element{old blogger interface} 3.click on add new gadget 4. goto html/java script gadget click there 5. copy this codes <a href='http://www.freedomain.co.nr/' title='Free Domain Name'><img alt='Free Domain Name' src='http://szsmnua.imdrv.net/soof62.gif' style='width:88px;height:31px;border:0;'/></a> it look like this 6.and click on save 7. then again follow steps 3-5 8.then now copy this codes <a href="http://vastgk.blogspot.in/" target="_blank"><img border="0" alt="Tips for New Bloggers" width="120" src="http://i154.photobucket.com/albums/s255/ownlblog/tipsbanner80x15.gif" height="15"/> </a> itlook like this 9. click on save ...

Reserved Words In JAVA (total 53 Reserve Words)

RESERVED WORDS: In java the words which are having fixed functionalities or fixed Values are called as reserve words. Total Number of reserve words =53. Category of Reserve Words: 1 .Keywords ---> The words which are having fixed Functionalities. 2. Literals (Constant)---->The words which are having fixed Values .(3)---- i) true ii) false iii) null. NOTE: all the reserved words (Keywords and Literals) are in small letters. Keywords: (i) Datatype related :- byte ,short,int ,long,float,double,char,boolean. (ii) Flow Control Related Keywords: - if ,else ,switch,case ,default,continue,break,for,while,do while. (iii) Method Related Keywords:- void ,return. (iv) Unused keywords: goto ,const. (v) New Keywords: assert,enum. (vi) exception handling Keywords: try,catch,finally,throws,throw. (vii) Class Related keywords : class,extends,interface,implements,pacakage,import. (viii) Object Related Keywords: this,new,super,instanceof. ...

HOW TO SEND CONFIRMATION MAIL WITH GRAVITY FORMS

Hover over the  Settings  and select  Notifications  from the options. On the resulting page you’ll see multiple notifications. You can either edit existing one or you can click on Add New button to create a new notification. Now click on  Add New  button to create new notification. You’ll see the screen like below screenshot: Name Notification should be given a name which is for your internal reference. This notification name will be shown on the previous screen. Send To This option allows you to set the email address where this notification email will be sent. You’ll find three options:  Enter Email ,  Select a Field  and  Configuring routing . Enter email  allows you to define the email address manually where the email will be sent. If you {admin-email} in this section then it will send notification to the email address you specified in your website setting. Select a Field  is used if you have multiple em...

JAVA program to Calculate Factorial using Function Interface (involve lambdas )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import java.util.Scanner ; import java.util.function.Function ; public class fact { public static void main ( String [] args ) { Function < Integer , String > fact =( n )-> { String res = "Factorial of " + n + " is=" ; double a = 1 ; for ( int i = 1 ; i <= n ; i ++) a *= i ; return res + a ; }; Scanner in = new Scanner ( System . in ); System . out . print ( "Enter the number :" ); int num = in . nextInt (); System . out . println ( fact . apply ( num )); } }

How to Block someones sim

Here im sharing a new trick to block anyone sim. All you have to do is just enter this number in victims cell phone **04*3814*7529*68243# This will ask to enter a puk code. Just enter any random digit and your victim's sim will be blocked. note i am not responsibal for any problem if u face..this is for educatioan l purpose only