Help please not compilable

my program is not Compilable
this program takes the numbers and has to put sorted
numbers out

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65



#include <stdio.h>

int main(void)
{
    float variable[10];
    int i;
    for(i=0; i< 10; i++)
    {
        scanf("%f", &variable[i]);
    }
    printf("numbers in array: \n");
    for(i=0, i< 10, i++)
    {
        printf("%f -- ", variable[i]);
    }
    printf("\n\n");
    printf("lowest: \n");

    float lowest;
    lowest = variable[0];
    for(i=0, i< 10, i++)
    {
        if(lowest > variable[i])
        {
            lowest = variable[i];
        }
    }
    printf("%f\n", lowest);

    int start;
    int minPos;
    float change;
    for(start=0, start < 10, start++)
    {
        lowest = variable[start];
        minPos = start;
        for(i=start; i< 10; i++)
        {
            if(lowest > variable[i])
            {
                lowest = variable[i];
                minPos = i;
            }
        }
        change = variable[minPos];
        variable[minPos] = variable[start];
        variable[start] = change;
    }

    printf("sorted numbers: \n");
    for(i=0, i< 10, i++)
    {
        printf("%f -- ", variable[i]);
    }


    return 0;
}



What's the first error the compiler says?
Hello cupdater,

Is your intent to write a C program or a C++ program?

Your for loops are a problem.

"scanf" may work for you, but it does not work for me.

Andy
You need to use a ; instead of , in your for loops. Once you have done it it compiles.
https://www.tutorialspoint.com/cprogramming/c_for_loop.htm
Last edited on
thank you thomas
there was missing ; instead of ,
Topic archived. No new replies allowed.