Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

makuks / iax0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 8bd73eab authored 6 years ago by makuks's avatar makuks
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Upload New File

parent ec86c5fe master
Show whitespace changes
Inline Side-by-side
Showing with 45 additions and 0 deletions
  • LAB3/task2.c
LAB3/task2.c 0 → 100644
View file @ 8bd73eab
#include <stdio.h>
int main()
{
int i, n, t1 = 0, t2 = 1, t3;
printf("Enter the size of the array: ");
scanf("%d", &n);
int a[n];
printf("Fibonacci Series: ");
for (i = 0; i < n; i++)
{
a[i]=t1;
t3 = t1 + t2;
t1 = t2;
t2 = t3;
}
for (i=0; i<n; i++)
{
printf ("%d ", a[i]);
}
printf ("\n");
for (i=n-1; i>=0; i--)
{
printf ("%d ", a[i]);
}
printf("\n");
{
for (i = 0; i < n; i++)
if(a[i] % 2 == 1)
printf("%d ", a[i]);
}
printf("\n");
{
for (i = 0; i < n; i++)
if(a[i] % 2 == 0)
printf("%d ", a[i]);
}
return 0;
}
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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