Start New Discussion Reply to this Discussion how to write superscript in core java
Hi all.. I m a begginer in java... i want to write a series like 1 to the power 2, 2 to the power 3 as so on... i can print its value only line 1 , 8 , 81...
but i cant write the series where all to the power number will be in superscript order... pls can anyone help me?? here is my code where i found only the values of 1 to the power2 , 2 to the power 3....
import java.io.*;
class srs3
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int i,n,m;
System.out.println("Enter the range:-");
n=Integer.parseInt(br.readLine());
System.out.println();
System.out.println("The series upto "+n+" is: ");
System.out.println();
for(i=1;i<=n;i++)
{
int s=(int) Math.pow(i,(i+1));
System.out.print(s+" ");
}
}
}
thanks in advance.... :)
Related Article: WARNING: New zero-day for Java 6u41 and Java 7u15
is a Java discussion thread by happygeek that has 11 replies, was last updated 2 months ago and has been tagged with the keywords: java, news, security, exploit, vulnerability, zero-day.
pri.chakraborty
Newbie Poster
1 post since Feb 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
uurcnyldrm
Light Poster
26 posts since Jan 2012
Reputation Points: 7
Solved Threads: 0
Skill Endorsements: 0
radhakrishna.p
Posting Whiz in Training
272 posts since Nov 2012
Reputation Points: 29
Solved Threads: 60
Skill Endorsements: 11
© 2013 DaniWeb® LLC
Page generated in 0.0645 seconds
using 2.83MB