Q:

How to create C program to determine lagest number by entered value?

I've created a program to determine largest number, but my lecturer says it isn't perfect, can anybody make it perfect?
 #include <stdio.h>
 int main () {
     double a,b=0,n, i;
     printf("limit of n input: ");
     scanf ("%lf",&n);

     for (i=1;i<=n;i++) {
         scanf("%lf",&a);
         if (a>b) b=a;
     }

     printf("%.2lf", b);

     return 0;
 }

A:

I would do it that way, sorry for the mass of text. I think it is coming from the typical Objective-C style programming with long words:
#include <stdio.h>

int clean_stdin() {
    while (getchar()!='\n');

    return 1;
}

int main(int argc, char *argv[]) {
    char c;
    signed int count = 0;    // number of numbers to scan

    unsigned int fireErrorMessage = 0;
    do {
        if (fireErrorMessage == 1) {
            printf("You entered not a positive natural number. Please enter a number >0 Examples: 1 22 4012\n"); // output for the user
        }
        if (fireErrorMessage == 0) {
            fireErrorMessage = 1;
        }
        printf("How many integers do you want to insert (Inser a number >0)? ");
    } while (((scanf("%d%c", &count, &c) != 2 || c != '\n') && clean_stdin()) || count < 1);

    signed int indexOfNumber; // for index, declared outside because of output at the end

    signed int highestNumberIndex;
    double highestNumber; // saving the highest value in a helper variable

    fireErrorMessage = 0;
    for (indexOfNumber = 1; indexOfNumber <= count; indexOfNumber++) {
        double scannedNumber;
        do {
            if (fireErrorMessage == 1) {
                printf("You entered not a number. Please enter a number. Examples: 3.0 -1 14\n"); // output for the user
            }
            if (fireErrorMessage == 0) {
                fireErrorMessage = 1;
            }
            printf("Input number %d: ", indexOfNumber); // output for the user
        } while (((scanf("%lf%c", &scannedNumber, &c) != 2 || c != '\n') && clean_stdin()));

        fireErrorMessage = 0;

        if (indexOfNumber == 1 || scannedNumber > highestNumber) {
            highestNumberIndex = indexOfNumber;
            highestNumber = scannedNumber;
        }
    }

    printf("Highest input number on index %d, the value is about %.2lf\n", highestNumberIndex, highestNumber);

    return 0;
}

Output
How many integers do you want to insert (Inser a number >0)? aa5
You entered not a positive natural number. Please enter a number >0 Examples: 1 22 4012
How many integers do you want to insert (Inser a number >0)? -3
You entered not a positive natural number. Please enter a number >0 Examples: 1 22 4012
How many integers do you want to insert (Inser a number >0)? 3
Input number 1: aa
You entered not a number. Please enter a number. Examples: 3.0 -1 14
Input number 1: -50.0001
Input number 2: 51a
You entered not a number. Please enter a number. Examples: 3.0 -1 14
Input number 2: -1.00
Input number 3: -0.1
Highest input number on index 3, the value is about -0.10

