Adblock breaks this site

what worng with my script (c)

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

  1. M_A_D

    M_A_D Active Member
    Banned

    Joined:
    Apr 8, 2006
    Posts:
    212
    Referrals:
    0
    Sythe Gold:
    0
    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;
    }
     
  2. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    what worng with my script (c)

    At least post what the error/exception was.
     
  3. M_A_D

    M_A_D Active Member
    Banned

    Joined:
    Apr 8, 2006
    Posts:
    212
    Referrals:
    0
    Sythe Gold:
    0
    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...)
     
  4. super_

    super_ Member

    Joined:
    Dec 20, 2008
    Posts:
    91
    Referrals:
    0
    Sythe Gold:
    0
    what worng with my script (c)

    For starters, it's not a script.
     
  5. war833

    war833 Member

    Joined:
    Dec 11, 2008
    Posts:
    82
    Referrals:
    0
    Sythe Gold:
    0
    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.
     
  6. M_A_D

    M_A_D Active Member
    Banned

    Joined:
    Apr 8, 2006
    Posts:
    212
    Referrals:
    0
    Sythe Gold:
    0
    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?
     
  7. d great one

    d great one Apprentice

    Joined:
    Nov 4, 2007
    Posts:
    930
    Referrals:
    2
    Sythe Gold:
    0
    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? >


 
 
Adblock breaks this site