Write a menu driven program to display a)Prime numbers upto a certain limit. b)Fibonacci series upto a certain limit.
Answers
Answer:
In 1927 there was a war between kottayam and palakkad in which palakkad lose the battle and it was captured by Ali Khan
Explanation:
This is the history of Palakkad and many other places
Answer:
C program for prime numbers to a certain limit
//prime numbers till a value
#include<stdio.h>
int main(){
int input=0;
scanf("%d",&input);
int number=2;
int i=0;
while(number<=input){
i=2;
while(i<number){
if(number%i==0){
break;
}
i++;
}
if(i==number){
printf("%d\n",number);
}
number++;
}
return 0;
}
--------------------------------------------------------------------------------------------------------
C program for fibanocci numbers till a certain limit
#include<stdio.h>
//fibanocci numbers
int main(){
int input=0; // limit stored in a
int f=0;
int f_prev=0;
int f_int=0;
scanf("%d",&input);
while(f<=input){
if(f==0){
printf("%d\n",0);
f++;
}
else{
printf("%d\n",f);
f_int=f;
f=f+f_prev;
f_prev=f_int;
}
}
return 0;
}
Explanation: