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.
Answers were Sorted based on User's Feedback
Answer / karthik
#include<iostream.h>
int main()
{
int a=-1,b=1,c,n;
printf("Enter the length of series");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
c=a+b;
a=b;
b=c;
printf("%d",c);
}
return 0;
}
| Is This Answer Correct ? | 11 Yes | 2 No |
Answer / 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 |
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.
swap prog
Write a program using two-dimensional arrays that determines the highest and lowest of the 12 input values. Example: Enter 12 numbers: 13 15 20 13 35 40 16 18 20 18 20 14 highest: 40 lowest: 13
A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect
write a program that calculate the volume of cylinder after user enters radius and height and show the algorithm used
1 Answers Jomo Kenyatta University,
What will be the output- for(i=1;i<=3;i++) { printf("%d",i); continue; i++; }
Write a program to enter 10 number of integer entries into an array n and then odds up all the odd entries. the program then displays the result. plssss answer assss fast asss u can...
Write a program using one dimensional array that searches a number and display the number of times it occurs on the list of 12 input values. Sample input/output dialogue: Enter 12 values: 13 15 20 13 30 35 40 16 18 20 18 20 Enter number to search: 20 Occurences: 3
We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character
write a proram using exceptional handling create a error & display the message "THERE IS AN ERROR?... PLEASE RECTIFY"?
How to Split Strings with Regex in Managed C++ Applications?
what is the best algorithm to sort out unique words from a list of more than 10 million words(1 crore+)? we need the best technique in the terms of execution time.