Thread: Help me out fellow comrades !

  1. #1
    Registered User
    Join Date
    Nov 2015
    Posts
    2

    Cool Help me out fellow comrades !

    Hi there,

    I'm having a problem with a matrix, I cannot figure out a part of the assignment and I hope someone will help me out.
    This is the full assignment:

    -"Write a program in which you will enter a matrix from the keyboard, find the maximum and minimum element of the matrix and find the average value of those elements, after that every element that is in the matrix which is bigger then the average value change it and put the average value in its place."
    (Was translating this and I hope you can understand it.)

    The part that is bold and underlined is the part I'm having a problem with.
    Any kind of solution is welcome, I'll be brainstorming meanwhile.

    Cheers

  2. #2
    Registered User
    Join Date
    Aug 2015
    Posts
    26
    something like this?? I think this is what your asking, although I could be totally wrong
    Code:
    for(int i = 0;i < TOTAL_VALUES_IN_MATRIX;i++)
    {
        if(MATRIX[i]>AVERAGE)
            MATRIX[i]=AGERAGE;
    }

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,730
    Devoted my life to programming...

  4. #4
    Registered User
    Join Date
    Nov 2015
    Posts
    2
    Quote Originally Posted by YayIguess View Post
    something like this?? I think this is what your asking, although I could be totally wrong
    Code:
    for(int i = 0;i < TOTAL_VALUES_IN_MATRIX;i++)
    {
        if(MATRIX[i]>AVERAGE)
            MATRIX[i]=AGERAGE;
    }
    You ain't wrong, helped me a bunch I just added another for cycle and it worked like a charm. Thanks mate Cheers

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. For a Fellow Programmer
    By slain in forum C++ Programming
    Replies: 8
    Last Post: 01-29-2013, 03:54 PM
  2. Hello fellow survivors
    By Mario F. in forum General Discussions
    Replies: 13
    Last Post: 12-24-2012, 03:15 PM
  3. Hello to fellow programmers out there
    By eurosickwitit in forum General Discussions
    Replies: 8
    Last Post: 11-18-2011, 05:18 AM
  4. Howdy Comrades
    By bonFloaliaFaf in forum General Discussions
    Replies: 2
    Last Post: 09-10-2009, 05:36 PM
  5. Fellow c programmers
    By rmc in forum C Programming
    Replies: 4
    Last Post: 03-31-2009, 06:16 PM

Tags for this Thread