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

viakul / 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 6d83eaec authored 6 years ago by viakul's avatar viakul
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

all

parent 06b55f49 master
Show whitespace changes
Inline Side-by-side
Showing with 113 additions and 0 deletions
  • Lab3/array10num
  • Lab3/array10num.c
  • Lab3/array10num.o
  • Lab3/bonusTask
  • Lab3/bonusTask.c
  • Lab3/bonusTask.o
  • Lab3/fibonachiSeq
  • Lab3/fibonachiSeq.c
  • Lab3/fibonachiSeq.o
Lab3/array10num 0 → 100644
View file @ 6d83eaec
File added
This diff is collapsed. Click to expand it.
Lab3/array10num.c 0 → 100644
View file @ 6d83eaec
#include <stdio.h>
int main(){
int first[10]={0};
int i;
for (i=1; i<11; i++){
first[i-1]=i;
}
printf("Even numbers: \n");
for(i=0; i<10; i++)
{
if (first[i]%2==0)
{
printf("%d \n", first[i]);
}
}
printf("odd numbers: \n");
for (i=0; i<10; i++){
if (first[i]%2==1)
{
printf("%d\n", first[i]);
}
}
printf("Reverse order \n");
for (i=9; i>-1; i--){
printf("%d\n", first[i]);
}
return 0;
}
This diff is collapsed. Click to expand it.
Lab3/array10num.o 0 → 100644
View file @ 6d83eaec
File added
This diff is collapsed. Click to expand it.
Lab3/bonusTask 0 → 100644
View file @ 6d83eaec
File added
This diff is collapsed. Click to expand it.
Lab3/bonusTask.c 0 → 100644
View file @ 6d83eaec
#include <stdio.h>
int main(){
int User[10];
int i;
int n1;
int n2;
n1=1;
n2=1;
for (i=0; i<10; i++){
printf("write your number: \n");
scanf("%d", &User[i]);
}
for (i=0; i<9; i++)
{
if (User[i]>=User[i+1])
n1=0;
}
if (n1==1){
printf("This is ascending order");
}
for (i=0; i<9; i++)
{
if (User[i]<=User[i+1])
n2=0;
}
if (n2==1){
printf("This is decending order");
}
if ((n1==0)&&(n2==0))
{
printf("This is neither decending order nor ascending order ");
}
return 0;
}
This diff is collapsed. Click to expand it.
Lab3/bonusTask.o 0 → 100644
View file @ 6d83eaec
File added
This diff is collapsed. Click to expand it.
Lab3/fibonachiSeq 0 → 100644
View file @ 6d83eaec
File added
This diff is collapsed. Click to expand it.
Lab3/fibonachiSeq.c 0 → 100644
View file @ 6d83eaec
#include <stdio.h>
int main(){
int n;
int i;
printf("Enter the fibnachi number N\n");
scanf("%d", &n);
int fib[n];
fib[0]=1;
fib[1]=1;
if (n>1){
for (i=2; i<n; i++){
fib[i]=fib[i-1]+fib[i-2];
}
}
printf("Even numbers: \n");
for(i=0; i<n; i++)
{
if (fib[i]%2==0)
{
printf("%d \n", fib[i]);
}
}
printf("odd numbers: \n");
for (i=0; i<n; i++){
if (fib[i]%2==1)
{
printf("%d\n", fib[i]);
}
}
printf("Reverse order \n");
for (i=n-1; i>-1; i--){
printf("%d\n", fib[i]);
}
return 0;
}
This diff is collapsed. Click to expand it.
Lab3/fibonachiSeq.o 0 → 100644
View file @ 6d83eaec
File added
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