Search:

Type: Posts; User: Macgrubber

Search: Search took 0.11 seconds.

  1. Replies
    1
    Views
    395

    Help with this code

    for(row = 0 ; row < size ;row++){
    result = 0;
    for (col = 0 ; col < size ; col++)
    result = matrix[row][col] +result;
    magic = result;

    sumRows[row]= result;
    if...
  2. Replies
    4
    Views
    772

    Re: help 2d array confusion

    result = 0;
    for(row = 3 ; row >= 0; row--){
    result = matrix[row][row] +result;
    }
    sumDiag2 = result;
    if (sumDiag2 == magic){
    System.out.println("Minor Diagonal = "+ sumDiag2 + ...
  3. Replies
    4
    Views
    772

    help 2d array confusion

    int [] [] matrix = {
    {16, 3, 2, 13},
    {5, 10, 11, 8},
    {2, 6, 7, 12},
    {2, 15, 14, 1}
    };



    result = 0;
  4. Replies
    2
    Views
    393

    Re: about printf please help having errors

    oh thanks its working now...
    so all i needed to do is get rid of the +" "; after the array
    thank you and yeah thanks again for the advice ill be more careful next time with my practices..

    and...
  5. Replies
    2
    Views
    393

    about printf please help having errors

    System.out.print("\nList 2 : ");
    for (i = 0 ; i<list.length ; i++){
    list2 [i] =(int)(99*Math.random()+1);
    System.out.printf("\n%2d",list2[i] + " ");
    }

    i want to display random nos. with a...
  6. Replies
    3
    Views
    347

    Re: aligning help

    it doesnt work because if a number with 1 digit comes up then the alignment will be all messed up... :( need help my instructor specifically told us to watch out for the alignments...

    i think its...
  7. Replies
    3
    Views
    347

    aligning help

    System.out.print("\nList 2 : ");
    for (i = 0 ; i<list.length ; i++){
    list2 [i] =(int)(99*Math.random()+1);
    System.out.printf(list2[i], " %2d");
    }


    i have this code... i want to align...
  8. Replies
    2
    Views
    806

    help with loops... :(

    im doing a for loop that goes like this.... for (i=1 , i<=30000 , i++)
    ok but want to printout a result every 1000 of the time.... how to do that.. please..
  9. Replies
    8
    Views
    1,442

    Re: Help so stumped....

    o yeah thanks that was some big of a help.... :)
  10. Replies
    8
    Views
    1,442

    Re: Help so stumped....

    it works if i the 1st number i enter is positive but if you enter a negative number 1st then it has problems :(
  11. Replies
    8
    Views
    1,442

    Re: Help so stumped....

    their initialized to 0 because if the user enters the first number.. it checks the number if its <0 or >0 then it enters the loop...
  12. Replies
    8
    Views
    1,442

    Re: Help so stumped....

    so can you tell me whats wrong? i cant seem to determine... thanks i didnt realize that problem now im even more confused.... :(
  13. Replies
    8
    Views
    1,442

    Help so stumped....

    i have this program.. basically it keeps reading an integer until the user inputs 0... then it outputs the count of positives and negatives, the sum of the postives and the negatives, largest values...
Results 1 to 13 of 13