1.11M Members

how to write superscript in core java

 
0
 

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.... :)

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: