Q:

Java - do while Statement

0

This Program is used to demonstrate the do-while concept.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

import java.io.*; 

class ssvdowhile 
{ 
public static void main(String arg[]) throws IOException 
{ 
String t; 
int c,n; 
c=0; 

DataInputStream dr = new DataInputStream(System.in); 

System.out.print("Enter a whole Number : "); 
t = dr.readLine(); 
n = Integer.parseInt(t); 

do

{ 
n = n/10; 
c = c+1; 
}while(n != 0); 

System.out.println("\nThe given Number is a " + c + " Digit Number"); 
} 
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now