d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > What's Wrong With My Code?
Add Reply New Topic New Poll
Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Oct 14 2015 01:57am
Code
//loops char variable till value is z

class char {
public static void main(String args[]) {

char ch;
ch = 'A';

for (ch = 'A'; ch <= 'Z'; ch + 1)
System.out.println ("ch is " + ch);

System.out.println ("Done!");

}
}




I'm trying to increment char variable ch, till it hits Z
Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Oct 14 2015 02:03am
nvm figured it out
here's new code


Code
//loops char variable till value is z

class chars {
public static void main(String args[]) {

char ch;
ch = 'A';

for (ch = 'A'; ch <= 'Z'; ch++)
System.out.println ("ch is " + ch);

System.out.println ("Done!");

}
}
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll