Help need for a C program! SOS

Filed Under mercialleasing.com |

  • Hi guys i'm new to C programming. I've a small assignment program,

    Write a Program to accept 10 numbers using one dimensional array and display them.

    here how i tried, but haven't executed.

    int a[10],i,n;
    printf(Enter the number of elements");
    scanf("%d", &n);
    printf("Enter the elements");
    for (i=0;i scanf("%d", &a[i])

    and the print statement


  • Then what is the problem ???
    All the statements can work.

    Only problem can arise is that if I enter number of elements as >10, then it will overwrite to some other memory area.


  • after ur last statement i.e.scanf statement there will be a ; semicolon


    and ya when value is n is less than 10 then it will work surely but if input value of n greater than 10 then it will produce errors as that will be on garbage addresses


  • EXECUTED, its working.


    +++ RESOLVED +++







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Help need for a C program! SOS , Please add it free.

    Comments