what worng with my script (c)

Discussion in 'Programming General' started by M_A_D, Sep 16, 2009.

what worng with my script (c)
  1. Unread #1 - Sep 16, 2009 at 2:33 PM
  2. M_A_D
    Joined:
    Apr 8, 2006
    Posts:
    212
    Referrals:
    0
    Sythe Gold:
    0

    M_A_D Active Member
    Banned

    what worng with my script (c)

    well i know i am noob i am trying to learn this

    i tryed to do a script that get 10 numbers and printt it from the lowest to the highest

    what worng with this script


    #include <stdio.h>
    #include <conio.h>

    void main( )
    {
    int i, g, z;
    int A[10]; // New array with 10 cells non initialized

    for (i=0;i<10;i++)

    {
    scanf ("%d", &g);
    A= g ;
    }

    for (i=0;i<9;i++)
    {
    if (A[i-1]>A)

    A[i-1]=z;
    A=A[i-1];
    A[i-1]=A;
    }
    printf("A = %d\n", A) ;

    getch();
    //return 0;
    }
     
  3. Unread #2 - Sep 16, 2009 at 3:29 PM
  4. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    what worng with my script (c)

    At least post what the error/exception was.
     
  5. Unread #3 - Sep 16, 2009 at 4:41 PM
  6. M_A_D
    Joined:
    Apr 8, 2006
    Posts:
    212
    Referrals:
    0
    Sythe Gold:
    0

    M_A_D Active Member
    Banned

    what worng with my script (c)

    i supposed to get 10 numbers from the lowest to the highest and 10 times same default number ( -85899...)
     
  7. Unread #4 - Sep 16, 2009 at 5:06 PM
  8. super_
    Joined:
    Dec 20, 2008
    Posts:
    91
    Referrals:
    0
    Sythe Gold:
    0

    super_ Member

    what worng with my script (c)

    For starters, it's not a script.
     
  9. Unread #5 - Sep 16, 2009 at 5:37 PM
  10. war833
    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0

    war833 Member

    what worng with my script (c)

    >____>

    Program dude, program.

    Start to call it that instead of a script and you'll sound much better already.
     
  11. Unread #6 - Sep 16, 2009 at 8:24 PM
  12. M_A_D
    Joined:
    Apr 8, 2006
    Posts:
    212
    Referrals:
    0
    Sythe Gold:
    0

    M_A_D Active Member
    Banned

    what worng with my script (c)

    look i just start doing it so i dont know names i dont know alot of things if i dont know tell me u dont have to tallk like that this is annoying


    and i know i speak like 13 year old kid but i am not i do it because englise aint my first language


    any one can do a real help?
     
  13. Unread #7 - Sep 17, 2009 at 5:29 AM
  14. d great one
    Joined:
    Nov 4, 2007
    Posts:
    930
    Referrals:
    2
    Sythe Gold:
    0

    d great one Apprentice

    what worng with my script (c)

    For starters, I don't know what you are scanning.

    Code:
    #include <stdio.h>
    #include <conio.h>
    
    void main( )
    {
    int i, g, z;
    int A[10]; // New array with 10 cells non initialized
    
    for (i=0;i<10;i++)
    
    {
    scanf ("%d", &g); //I don't know what you are scanning here. Since loop starts and end in order, why not try to get a user input?
    A[i]= g ;
    }
    
    for (i=0;i<9;i++)
    {
    if (A[i-1]>A[i])
    
    A[i-1]=z;
    A[i]=A[i-1];
    A[i-1]=A[i];
    }
    printf("A[i] = %d\n", A[i]) ;
    
    getch();
    //return 0;
    }
    
     
< Need private professional css hack coder | How do I post a comment on youtube through a webbrowser in visual basic 6? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site