Commit 429e7b48 by ilahma

Upload New File

parent 163bd416
Showing with 66 additions and 0 deletions
#include<stdio.h>
int main()
{
int i=0;
int N=0;
int l=0;
int b=1;
int c;
printf("Please enter size of array\n");
scanf("%d", &N);
int array[N];
a[0]=0;
for(i=0;i<N;i++)
{
if(i<2)
a[i]=i;
else
{
c=l+b;
l=b;
b=c;
a[i]=c;
}
printf("%d\n",a[i]);
}
printf("\n");
for(i=0; i<N; i++)
{
if(a[i]%2==1)
{
printf("%d\n",a[i]);
}
}
printf("\n");
for(i=0; i<N; i++)
{
if(a[i]%2==0)
{
printf("%d\n",a[i]);
}}
printf("\n");
for(i=N; i>=0; i--)
{
printf("%d\n",a[i]);
}
printf("\n");
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment