21st May 2019, 12:43 PM
Bintang Pratomo
Bintang Pratomo - avatar
6 Réponses
+ 1
import java.util.*; public class Program { public static void main(String[] args) { Scanner sc=new Scanner (System.in); int a=0,b=1,c; System.out.println ("enter end value"); int n=sc.nextInt(); System.out.print (a+" "+b); for (int i=3;i<=n;i++) { c=a+b; System.out.print(" "+c); a=b; b=c; } } }
21st May 2019, 12:58 PM
Shashwat Sahay
Shashwat Sahay - avatar
0
Help
21st May 2019, 12:43 PM
Bintang Pratomo
Bintang Pratomo - avatar
0
Big thanks for you shaswat
21st May 2019, 12:59 PM
Bintang Pratomo
Bintang Pratomo - avatar
0
😁
21st May 2019, 12:59 PM
Bintang Pratomo
Bintang Pratomo - avatar
0
Wlcm bro
21st May 2019, 1:00 PM
Shashwat Sahay
Shashwat Sahay - avatar
0
#fibonacci program in c #include<stdio.h> int main() { int n1=0,n2=1,n3,i,number; printf("Enter the number of elements:"); scanf("%d",&number); printf("\n%d %d",n1,n2);//printing 0 and 1 for(i=2;i<number;++i)//loop starts from 2 because 0 and 1 are already printed { n3=n1+n2; printf(" %d",n3); n1=n2; n2=n3; } return 0; }
21st May 2019, 1:50 PM
Anil
Anil - avatar