Sesiones de PyR
Chess tournment
0 Votos
2 RespuestasWrite a static method called weave that that takes two integers as parameters and that returns the result of weaving their digits together to form a single integer. Two numbers x and y are weaved together as follows. The last pair of digits in the result should be the last digit of x followed by the last digit of y. The second-to-the-last pair of digits in the result should be the second-to-the-last digit of x followed by the second-to-the-last digit of y. And so on.
0 Votos
13 RespuestasOutput of C++ code
0 Votos
2 RespuestasCan 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 RespuestasIt dawned on me! #3
1 Voto
1 RespuestaHtml layouts
0 Votos
3 Respuestaswhere's the error ?
-3 Votos
2 Respuestasusing System;
namespace GoodProgrammerTest
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter Yes or No");
Console.Write(
"Do you programme every day? : ") ;
int answer = Console.ReadLine();
if (answer =="Yes")
{
Console.WriteLine(
"You will be a good programmer");
}
else
{
Console.WriteLine(
"You will not be a good programmer");
}
}
}
}
2 Votos
3 Respuestasclass and object
1 Voto
1 RespuestaWhye error???
0 Votos
1 RespuestaI am confused on this
0 Votos
1 Respuestapublic class Vehicle {
int maxSpeed;
int wheels;
String color;
double fuelCapacity;
void horn() {
System.out.println("Beep!");
}
}
class MyClass {
public static void main(String[ ] args) {
Vehicle v1 = new Vehicle();
Vehicle v2 = new Vehicle();
v1.color = "red";
v2.horn();
System.out.println(v1);
}
}
Explain its outcome. I am unable to get the last line of outcome.
-1 Voto
2 Respuestasjava learning
0 Votos
1 RespuestaWhy not working
-4 Votos
4 RespuestasEn tendencia hoy
Help please?
3 Votes
Ejercicio Pytho
0 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes
Ruby programming?
3 Votes