using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("masukan jumlah deret");
int a=int.Parse(Console.ReadLine());
int i = 1;
int x=1;
int y=1;
Console.Write("{0}",x);
Console.Write(" {0}",y);
while (i<=(a-2))
{
y=(y+x);
x = (y - x);
Console.Write(" {0}",y);
i=(i+1) ;
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("masukan jumlah deret");
int a=int.Parse(Console.ReadLine());
int i = 1;
int x=1;
int y=1;
Console.Write("{0}",x);
Console.Write(" {0}",y);
while (i<=(a-2))
{
y=(y+x);
x = (y - x);
Console.Write(" {0}",y);
i=(i+1) ;
}
}
}
}
No comments:
Post a Comment