answersLogoWhite

0


Best Answer

I am going to assume you want a program to print out the Fibonacci series.

#include <stdio.h>

int main(int argc, char **argv)

{

if (argc < 2) {

printf("Usage: %s max\n", argv[0]);

return -1;

}

int a = 1, b = 1, c;

int max = atoi(argv[1]);

printf("%d %d ", a, b);

while (b < max) {

c = a + b;

a = b;

b = c;

if ((b <= max)) printf("%d ", b);

}

printf("\n");

return 0;

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a Programs in C for Fabonic Series?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can c write programs?

A programmer can write programs in C, but C can't write anything by itself.


What is the benift of learning c language?

You will be able to understand C programs. Also to write C programs.


Write c programs to display 10 line biodata?

A C++ program can be used to write C programs that will display 10 lines of biodata. Many types of C programming can be written with a C++ program.


Advantage of c language?

You can write computer-programs in it.


How do you write a palindrome program in c in Wikipedia?

You don't have to write palindrome programs in wikipedia.


Why c lang developd?

To write programs in it. A prominent example is UNIX.


Write a c program to solve cos series?

Please do.


How do you solve the c programme of tree of hanoi?

It is the "Tower of Hanoi" and it is a puzzle. When you can solve the puzzle you can write the program, when you have learned enough to write simple programs. You do want to be able to write computer programs, don't you?


How can you use gvim software to run c programs?

You cannot, but you can use any text-editor to write C sources.


Can you access c language in dos and unix?

You can write, compile and execute C-programs in both DOS and Unix, if that's what you meant.


Did C. S. Lewis write all the books in the Narnia series?

of course he did


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'