Need help with Java alphabet code
Hi!
I need some help with a JAVA code that is suppose to look like this when it's finished:
But now it's looking like this:
This is the code I have:
Whats wrong!?
Hi!
I need some help with a JAVA code that is suppose to look like this when it's finished:
aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ
zZ yY xX wW vV uU tT sS rR qQ pP oO nN mM lL kK jJ iI hH gG fF eE dD cC bB aA
But now it's looking like this:
aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ {[ |\ }] ~^ _ ?` ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z
?z ?y ?x ?w ?v ?u ?t ?s ?r ?q ?p ?o ?n ?m ?l ?k ?j ?i ?h ?g ?f ?e ?d ?c ?b ?a ?` _ ~^ }] |\ {[ zZ yY xX wW vV uU tT sS rR qQ pP oO nN mM lL kK jJ iI hH gG fF eE dD cC bB aA
This is the code I have:
Code:
public class alfabetet {
public static void main(String[] args)
{
// Denna koden gör så att alfabetet skrivs ut från a till z
for (char ch = 65; ch <= 122; ch += 1) // repetitionssats
{
System.out.printf("%c%c ", ch + 32, ch);
}
System.out.println();
// Koden som gör att alfabetet skrivs baklänges börjar här
for (char ch = 122; ch >= 65; ch -= 1) // repetitionssats
{
System.out.printf("%c%c ", ch + 32, ch);
}
System.out.println();
}
}
Whats wrong!?





