Program In C Language To Create A Fibonacci Series And Leap Year
1.Fibonacci number program in C initial 10 number
#include<stdio.h>
#include<conio.h>
void main()
{
int a=1,b=0;
int f=1;
printf("%d%d",a,b);
while(f<=10);
{
c=a+b;
printf ("%d\n",c);
f++;
a=b;
b=c;
}
getch();
}
2. Calculate leap year with the help of C program
#include<stdio.h>
#include<conio.h>
void main ()
{
int year;
printf("Enter any number");
scanf("%d",year);
if ((year%400==0)||(year%100!=0&&year%4==0))
printf("\n%d Is a leap year",year);
else
printf("\n%d Is not a leap year",year);
getch();
}
Comments
Post a Comment
DON'T COMMENT LINK.