[code] int n = 12345; int t,r = 0; System.out.println(“The original number : ” + n); do{ t = n % 10; r = r * 10 + t; n = n / 10; }while (n > 0); System.out.println(“The reverse number : ” + r); [/code]
guys.. will you help me to create a program .. in that program you can see the switch statement,do while loop and if else !! thank you for reading.. this is my project .. thank you guys.. for help me!! muah!!!
can I ask how to loop a java with choices like a, b , c, d and each letter has their own method that will only appear when selected Im asking is how to loop it when the process of the selected is finish how will it go back to choosing in the choices again
example of do while loop?
[code]
int n = 12345;
int t,r = 0;
System.out.println(“The original number : ” + n);
do{
t = n % 10;
r = r * 10 + t;
n = n / 10;
}while (n > 0);
System.out.println(“The reverse number : ” + r);
[/code]
Great implementation of the reverse function..Kudos!!!
this no is known to be as palindrome number in other java world………:)
owww
do while loop coding
public class dowhile {
public static void main(String arg[]){
int i=0;
do{
System.out.println(i);
i++;
}while(i!=10);
}
}
1
2
3
4
5
6
7
8
9
sir help me..how to get the same output of while loop,do-while loop,for loop.
like dis output
1
22
333
4444
55555
plsss help me..dis is my account plss send
for(int z = 1 ; z <=5 ; z ++)
{
for(int x = 1 ; x <=z ; x ++)
{
System.out.print(z);
}
System.out.println(“”);
}
run:
1
22
333
4444
55555
BUILD SUCCESSFUL (total time: 0 seconds)
how we get this answer?
public class Practice {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
for (int i =1; i<=5; i++){
for (int j = i; j>=1; j–)
System.out.print(i);
System.out.println(” “)
}
}
}
int start_value = 1;
do
{
System.out.println(i);
i++;
}while(i
please post in ur site another do while, while, for statement programs tnx
create a program that allows the user to input the 5 values then output the maximum value inputted.
import java.util.Scanner;
public class input
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int a,b,c,d,e;
S.O.P(“Enter all numbers:”);
a=in.nextInt();
b=in.nextInt();
c=in.nextInt();
d=in.nextInt();
e=in.nextInt();
if(a>b&&a>c&&a>d&&a>e){
S.O.P(“a is greater”);
}
if(b>a&&b>c&&b>d&&b>e){
SOP(“b is greater”);
}
if(c>a&&c>b&&c>d&&c>e){
SOP(“c is greater”);
}
if(d>a&&d>b&&d>c&&d>e){
SOP(“d is greater”);
}
if(e>a&&e>b&&e>c&&e>d){
SOP(“e is greater”);
}
else{
SOP(“numbers are identical”);
}
}
Create a program that will print a series of numbers based on what was entered by the user.
ex:
Sample output
1
2
3
4
Done
guys.. will you help me to create a program ..
in that program you can see the switch statement,do while loop and if else !!
thank you for reading.. this is my project ..
thank you guys.. for help me!! muah!!!
int z = 1;
switch(z)
{
case 0 :
{
System.out.println(“zero”);
break ;
}
case 1 :
{
int x = z ;
do
{
System.out.println(x);
if(x==0)
{
System.out.println(“error”);
break ;
}
else
{
x ++ ;
}
}
while(x<=5);
break ;
}
default :
{
System.out.println(z+” is > 1″);
break ;
}
}
what is the answer for this codes?? the complete format ,, please, I need your all help guys
PLEASE GUYS, this is my assignment, please, help me ;'(
Help me with this one.
Factorial.
Input:3
result:6
output:
3*2*1=6
using the do while statement
sir pls give example of while loop report… thanks you
can I ask how to loop a java with choices like a, b , c, d and each letter has their own method that will only appear when selected Im asking is how to loop it when the process of the selected is finish how will it go back to choosing in the choices again
the “D” of “do” should be in lower case
Sir can you send me 10 examples of DO WHILE LOOP and FOR WHILE LOOP. Please sir !