Placement Programs on C
1) Fibonacci Series Write a c program to print fibonacci series without using recursion and using recursion. Input: 10 Output: 0 1 1 2 3 5 8 13 21 34 #include<stdio.h> #include<conio.h> void main() { int n1=0,n2=1,n3,i,number; clrscr(); 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; } getch(); } 2) Prime number Write a c program to check prime number. Input: 44 Output: not prime number Input: 7 Output: prime number #include<stdio.h> #include<conio.h> void main() { int n,i,m=0,flag=0; clrscr(); printf("Enter the numbe...