¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuitaSesiones de PyR
Can 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 Votos
8 RespuestasWY I get a rundum number from memory when I run this code
#include <iostream>
using namespace std;
int main ()
{
int array [5];
for (int x = 0; x < 5; x++) {
array [x] = 42;
cout << x << ': ' << array [x] << endl;
}
return 0;
}
if I replace ': ' with ": " every thing works well.
0 Votos
2 RespuestasEn tendencia hoy
Polyalphabetic Cipher
0 Votes
Why didn't I get it?
1 Votes
Access deny problem
2 Votes
BOTSS
0 Votes
Help
0 Votes
A small question
0 Votes
How to use ai ?
0 Votes
C++20 module Cmake Source Code
1 Votes