Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Root calculation for the given number using Java
WhatsApp
Senthilvelan Sambamoorthy
Aug 13
2016
614
0
0
ssvroot.rar
// Root Calculation for given numbers
import
java.io.*;
import
java.text.*;
import
java.math.*;
class
ssvroot
{
public
static
void
main(String arg[])
throws
IOException
{
double
i,j,x,n;
System.out.print(
"Enter the float for table limit :"
);
BufferedReader br=
new
BufferedReader(
new
InputStreamReader(System.in));
n=Double.parseDouble(br.readLine());
NumberFormat nf=NumberFormat.getInstance();
nf.setMaximumFractionDigits(
2
);
System.out.print(
"No :"
);
for
(i=
0
;i<=n;i=i+
0.1
)
{
System.out.print(
"\t"
+ nf.format(i) );
}
System.out.println();
for
(i=
0
;i<=
9.0
;i=i+
1.0
)
{
System.out.print(
"\n"
+ i);
for
(j=
0
;j<=n;j=j+
0.1
)
{
x=i+j;
System.out.print(
"\t"
+ nf.format(Math.sqrt(x)));
}
}
}
}
Java
Up Next
Root calculation for the given number using Java