this is question and the answer...but i cannot compile it in dev c++ correctly..help me

//(a) Get five integer numbers from the user.
//( Store the numbers in an array called Number.
//© Display all the numbers on screen.
//(d) Modify the program so that it prints the reverse of the numbers.


//CONTOH OUTPUT :

//Enter numbers : 1
//Enter numbers : 2
//Enter numbers : 3
//Enter numbers : 4
//Enter numbers : 5


//1 2 3 4 5

//5 4 3 2 1

//Press any key to continue

#include<stdio.h>

 main()

{
    int i,Number[5];

    for (i=0; i<5; i++)
    
    {
        printf("Enter Number:    ");
        scanf("%d" ,&Number[i]);


    }


    for (i=0; i<5; i++)
    {
    
        printf("%d\t" ,Number[i]);

    }

    printf("\n");
            
    for(i=4; i>=0; i--)
    {

        printf("%d\t", Number[i]);


    }
    

}

help me to find the wrong

abov e program can also be written as:

void main()
{
------
-----
getch();
}

Yes, it can be...if you want your code to be subtly broken and non-portable. The main function returns int by definition. getch isn't a standard function, so you'd be relying on a library extension specific to your compiler.

The only way you could be more completely wrong is to introduce syntax errors into one of the four "this is real code" lines of that example.

This article has been dead for over six months. Start a new discussion instead.