Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobierenF&A Diskussionen
class and object
1 Stimme
1 Antwortwhy is it not running?
import java.util.Scanner;
public class Myclass{
public static void main(String [] args){
Scanner in = new Scanner(System.in);
String a;
int b;
System.out.println("enter a word");
a = in.nextLine();
System.out.println("enter repetition")
b = in.nextInt();
for ( int = 0; x < b; x = x++)
System.out.println(a);
}
}
0 Stimmen
8 AntwortenCan someone explain this code to me....
class ReverseNumberDemo
{ public static void main(String args[]) {
int num=123456789;
int reversenum =0;
while( num != 0 ) {
reversenum = reversenum * 10;
reversenum = reversenum + num%10;
num = num/10; }
System.out.println("Reverse of specified number is: "+reversenum);
}
}
the thing I don't get is the reversenum part......isn't reversenum=0 so wouldn't reversenum*10=0
0 Stimmen
8 AntwortenHeute heiß
Polyalphabetic Cipher
0 Votes
Why didn't I get it?
1 Votes
Access deny problem
1 Votes
BOTSS
0 Votes
A small question
0 Votes
Help
0 Votes
How to use ai ?
0 Votes
C++20 module Cmake Source Code
1 Votes