Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  program1
Language: JAVA
Code:
class prg
 {
   public void main accept( int x, int n)
      {
         int i,j,k;
         double s=0.0;
         for (i=1,j=1,k=1;j<=n;i++,k+=2,j++)
         if (j%2==0)
             s=s-i*Math.pow(x,k);
         else 
             s=s+i*Math.pow(x,k);
         System.out.println(s);
       }
  } 
Comments: