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

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

Upload New File

parent 39184b47 master
Hide whitespace changes
Inline Side-by-side
Showing with 37 additions and 0 deletions
  • Lab5PracticeTask1.c
Lab5PracticeTask1.c 0 → 100644
View file @ 37708be2
#include <stdio.h>
#include <math.h>
int main(){
// Declaration
int N;
int i;
int j;
printf("Enter size of array: ");
scanf("%d", &N);
// Declare array
int arr[N];
// Imput values in array
i = 0;
while(i < N){
printf("Enter value in array: ");
scanf("%d", &arr[i]);
i++;
}
i = 0;
while(i < N){
j = 0;
while(j < N - 1){
if(arr[j] < arr[j + 1]){
int swap = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = swap;
}
j++;
}
i ++;
}
for(i = 0; i < N; i++){
printf("%d ", arr[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