using System;
namespace fibonic
{
class Program
{
static void Main(string[] args)
{
int a=0, b=1,n, c, i;
Console.WriteLine("Enter no for fibonic series");
n = int.Parse(Console.ReadLine());
Console.WriteLine("Fibonic series is:");
Console.WriteLine(""+a);
Console.WriteLine("" +b);
for (i = 1; i <= n; i++)
{
c= a + b;
a= b;
b = c;
Console.WriteLine("" + c);
}
Console.ReadKey();
}
}
}
Output
Enter no for fibonic series
6
Fibonic series is:
0
1
1
2
3
5
8
13
This comment has been removed by the author.
ReplyDeletenice example
ReplyDeletei like that.
ReplyDeletegoo done ..can u plz upload the code for palindrome ..
ReplyDelete#include
Deleteusing namespace std;
int main(){
int n,num=0,rev=0,rem=0,sum=0;
cout<<"enter value of n"<>n;
num=n;
while(n>0){
rem=n%10;
rev=rev*10+rem;
n=n/10;
}
if(num==rev){
cout<<"pailendrone"<<endl;
}
else{
cout<<"not pailendrone"<<endl;
}
return 0;
}
This comment has been removed by the author.
ReplyDeleteint a = 1, b = 0, c = 0;
ReplyDeletefor (int i = 1; i < 10;i++ )
{
Console.Write("{0} ", a);
b = c;
c = a;
a = b + c;
}
Console.ReadKey();
its a perfect example
THANKS DEAR FOR THIS PROGRAM & THIS IS VERY NICE ARTICLE
ReplyDeleteWell done friend........ Simple and easy..
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCan you please write the program for the unmatching data from the two arrays. Like if A={1,3,7,9} B={2,3,5,7} then i want the output like O/P: 2,5 (i.e Unmatched data from the second array) Plz reply me soon.
ReplyDeleteohh so simple ...
ReplyDelete