Can I Put Large Bottles In Checked Baggage
-2 -3 -1 Asagidaki Soru bizden;
1) Klavyeden ASCII caracter olarak ve kodu girmemizi istiyor yazdirmamizi soyluyor.
2) Klavyeden caracter ASCII girmemizi ve kodu olarak yazdirmamizi istyor.
/ * Write a program that:
1) reads an ASCII keyboard and prints the corresponding character
. Expressly provide that the user can type
only integers correspond to ASCII codes.
2) reads a character from the keyboard and prints ASCII code.
* / public class
{public static void main (String [] args) {
/ * ASCII Klavyeden kodunu giriyoruz you okutuyoruz * /
Console.scriviStringa ("Writing an ASCII code: )
Console.leggiIntero int x = ();
/ * ASCII Asagida ise bir sayi girilmemesini kontrol kodu disinda ediyoruz * /
if (x \u0026lt;0
Console.scriviStr ("e '");
/ * ASCII karakter olarak kodunu yazdiriyoruz * /
Console.scriviCarattere ((char) x);}
/ * * Karekter olarak yazdiriyoruz /
Console . scriviStringa ("Now enter a character:");
Console.leggiCar char c = ();
/ * ASCII kodu olarak yazdiriyoruz * /
Console.scriviStringa ("The ASCII code of character" + c
+ "and '" + (int) c);}
}
0 comments:
Post a Comment