Sesiones 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
Help please?
4 Votes
Ejercicio Pytho
0 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
Game development
0 Votes
Ruby programming?
3 Votes