FIBONACCI SERIESCode CrazeFeb 2, 20231 min read#include <stdio.h>int main() { int n1=0,n2=1,temp; int n,i; printf("\nEnter the range : "); scanf("%d",&n); printf("\n%ld %ld ",n1,n2); for(i=2;i<n;i++) { temp=n1+n2; n1=n2; n2=temp; printf(" %ld",temp); }}
#include <stdio.h>int main() { int n1=0,n2=1,temp; int n,i; printf("\nEnter the range : "); scanf("%d",&n); printf("\n%ld %ld ",n1,n2); for(i=2;i<n;i++) { temp=n1+n2; n1=n2; n2=temp; printf(" %ld",temp); }}
Stack Using QueueA stack can be implemented using two queues in C. The basic idea is to use one queue for enqueue operations and another for dequeue...
Queue Using StackA queue can be implemented using two stacks in C. The basic idea is to use one stack for enqueue operations and another for dequeue...
Queue Using Array#include <stdio.h> #include<stdlib.h> #include<math.h> #define size 5 int queue[size]; int front = -1; int rear = -1; void enque(void);...
Comments