🔒 Closed Binary to ascii

Status
Not open for further replies.

Megabing213

Eternal Poster
Please nasa pic po hehe need code
 

Attachments

  • IMG_20190124_154808.jpg
    IMG_20190124_154808.jpg
    98.4 KB · Views: 15
Inisang Class ko nalang sya :)

import java.util.Scanner;

public class AssciiCoding {


public static void main (String args []) {
Scanner sc = new Scanner(System.in);


System.out.println("Binary into Characters");
System.out.print("Enter Binary:");
String binary = sc.nextLine();

//Binary to Character
int br = Integer.parseInt(binary,2);
char ch = (char)br;
System.out.println("Character with Binary code "+binary+" is "+ch);

//Character to ASCII
int ascii = (int)ch;
System.out.println("ASCII code of character "+ch+" is "+ascii);

//ASCII to Binary
String fBr = Integer.toBinaryString(ascii);
System.out.println("Binary code of ASCII code "+ascii+" is "+fBr);
}

}

upload_2019-1-26_11-36-56.png
 
Inisang Class ko nalang sya :)

import java.util.Scanner;

public class AssciiCoding {


public static void main (String args []) {
Scanner sc = new Scanner(System.in);


System.out.println("Binary into Characters");
System.out.print("Enter Binary:");
String binary = sc.nextLine();

//Binary to Character
int br = Integer.parseInt(binary,2);
char ch = (char)br;
System.out.println("Character with Binary code "+binary+" is "+ch);

//Character to ASCII
int ascii = (int)ch;
System.out.println("ASCII code of character "+ch+" is "+ascii);

//ASCII to Binary
String fBr = Integer.toBinaryString(ascii);
System.out.println("Binary code of ASCII code "+ascii+" is "+fBr);
}

}

View attachment 543200
Maraming salamat paps
 
Status
Not open for further replies.

About this Thread

  • 3
    Replies
  • 638
    Views
  • 2
    Participants
Last reply from:
OdenDi

Trending Topics

Online now

Members online
1,025
Guests online
878
Total visitors
1,903

Forum statistics

Threads
2,274,895
Posts
28,959,214
Members
1,233,482
Latest member
MyNameIsElga
Back
Top