I am not very good in software and trying to save my signal in an array and sort it from smal to big and array size is 10.
I have a signal for example x=1 and want to save t in array when it comes. but my code doesn't work. Any suggestions, Thanks
#include<stdio.h>
int i,j;
int array[10];
int sort(int sample);
int main()
{
int HEART,LEVEL;
printf("give a value to heart:");
scanf("%d",&HEART);
printf("give a value to level:");
scanf("%d",&LEVEL);
if (HEART>=LEVEL)
{
int sort(HEART);
}
int sort(int sample) {
int i,j;
for (j = 1; j < 10; j++) {
sample = array[j];
for (i = j-1; i >= 0 && array > sample; --i) {
array[i+1] = array;
}
array[i+1] = sample;
}