write a function -oriented program that generates the
Fibonacci, the current numbers of n(as input) and display
them (series). In Fibonacci, the current third number is the
sum of the previous number.
Answer Posted / mkk
#include<stdio.h>
void fibo(int x)
{
int f1=0,f2=1,f;
for(i=1;i<num;i++)
{
f=f1+f2;
f1=f2;
f2=f;
printlf(",%d",f2);
}
void main()
{
int num;
clrscr();
printf("enter the number");
scanf("%d",&num);
printf("0,1");
fibo(num);
getch();
}
| Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.
write a program that reads a series of strings and prints only those strings begging with letter "b"
write a program using virtual function to find the transposing of a square matrix?
Code for Two Classes for Doing Gzip in Memory?
write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
Code for Method of Handling Factorials of Any Size?
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
Write a simple encryption program using string function which apply the substitution method.
Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
develop a program to calculate and print body mass index for 200 employees
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
Code for Easily Using Hash Table?