We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d79ba1 commit e1afdf8Copy full SHA for e1afdf8
fibonacci_using_function_C.c
@@ -0,0 +1,29 @@
1
+/*
2
+ Program to print Fibonacci Series of Number
3
+ Author: jAs™
4
+ @grapie
5
+*/
6
+#include<stdio.h>
7
+#include<conio.h>
8
+void main()
9
+{
10
+ int n;
11
+ void fibo(int n);
12
+ clrscr();
13
+ printf("Enter a number: ");
14
+ scanf("%d",&n);
15
+ printf("Fibonacci Series\n0\n1\n");
16
+ fibo(n);
17
+ getch();
18
+}
19
+void fibo(int n)
20
21
+ int a=0,b=1,c,i;
22
+ for(i=1;i<=n-2;i++)
23
+ {
24
+ c=a+b;
25
+ printf("%d\n",c);
26
+ a=b;
27
+ b=c;
28
+ }
29
0 commit comments