Discussions Q&R
Chess tournment
0 Vote
2 RéponsesWrite 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 Vote
13 RéponsesOutput of C++ code
0 Vote
2 RéponsesCan 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 Vote
8 RéponsesIt dawned on me! #3
1 Vote
1 RéponseHtml layouts
0 Vote
3 Réponseswhere's the error ?
-3 Votes
2 Réponsesusing 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 Votes
3 Réponsesclass and object
1 Vote
1 RéponseWhye error???
0 Vote
1 RéponseI am confused on this
0 Vote
1 RéponseHungry wolves and fishing.
-1 Vote
1 Réponsepublic 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 Vote
2 Réponsesjava learning
0 Vote
1 RéponseWhy not working
-4 Votes
4 RéponsesAujourd'hui en vedette
Sticky position
2 Votes
Help please?
3 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
Ejercicio Pytho
0 Votes
SQL practice
2 Votes
Game development
0 Votes