রবিবার, ৩ মে, ২০১৫
Pyramid in C Language
লেবেলসমূহ:
C Programming
Fibonacci Series with C Programming
// Fibonacci Series in C Programming
#include<stdio.h>
int main(){
int n,i, a = 0, b = 1, fib;
printf("Enter the number of terms:");
scanf("%d",&n);
printf("First %d Number of Fibonacci series are :\t",n);
for ( i = 0 ; i < n ; i++ ){
if ( i <= 1 )
fib = i;
else{
fib = a + b;
a = b;
b = fib;
}
printf("%d\t",fib);
}
return 0;
}
Output
#include<stdio.h>
int main(){
int n,i, a = 0, b = 1, fib;
printf("Enter the number of terms:");
scanf("%d",&n);
printf("First %d Number of Fibonacci series are :\t",n);
for ( i = 0 ; i < n ; i++ ){
if ( i <= 1 )
fib = i;
else{
fib = a + b;
a = b;
b = fib;
}
printf("%d\t",fib);
}
return 0;
}
Output
লেবেলসমূহ:
C Programming
এতে সদস্যতা:
পোস্টগুলি (Atom)