Programming Code Sum of Fiboneci Number

class SumFiboneci1
     {
        public static void main(String args[])
              {
                int sum=0;

                System.out.println("The numbers and the sum are given below");

                for(int i=1;i<=10;i++)
                    {


                             System.out.println(i);
                             sum+=i;
                         }

             System.out.print("\n");
               System.out.print("Result    ;    " + sum);
              }

     }

0 comments: