Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: kjb
  • Order by date
  1. kjb

    math functions

    hey guys i just made a very simple if else program in which if i use cos or sin, or ne trig functin it comes false even tho its true! i'll paste the program below #include <cmath> #include <iostream> #include <stdio.h> #include <math.h> using namespace std; void main () { if...
  2. kjb

    max value in array columns

    Many thanks Basking The function you wrote worked like magic! Have a good day! kjb
  3. kjb

    max value in array columns

    Thanks Basking Actually I need to find the count of elements greater than a given value in 'each' column. In case of an array of 3 columns the return should be like: 2 6 4 Regards kjb
  4. kjb

    max value in array columns

    I could not figure out how to write a function that counts elements greater than given max value in columns of a matrix separately. Can somone help me, pls! I tried: [code] int count = 0; float max = 1.5; for ( i = 0; i < rows; i++) for ( j = 0; j < cols; j++) { if ( matrix[i][j] > max) count...
  5. kjb

    multidim arrays

    Russ After repeated attempts I figured out how to test the above functions. Everything works fine except in the last function I needed to modify the for loops to avoid jumping out of row and colums range: for ( i = 0; i < r-1; i++) for ( j = 0; j < c-1; j++) Still could not figure out how to...
  6. kjb

    multidim arrays

    Russ & MiBJ At last, I wrote that function! Will it work? I am still struggling to write a function to find values greater than threshold value in each column and to report the result column wise1 [code] float diff_max_adj(float matrix[ROWS][COLS], int r, int c) { int i, j; float r_max, c_max...
  7. kjb

    multidim arrays

    Russ & MiBJ Many thanks for your timely advice. I am sitting for an exam on Monday and I know that this type of problem carrys app 30% marks. I still can't figure out how to find 1. how many values in each column are greater than or equal to a given value (threshold). 2. the biggest...
  8. kjb

    multidim arrays

    Many thanks for your help! Am I on the right track? Suggestions/comments would be highly appreciated! How can I find the max difference between adjacent values in columns? How ca I compute the count of how many values in each column are greater than or equal to threshold value? #include...
  9. kjb

    multidim arrays

    Questions from a beginner: How can I find the sum and average value of elements of a multidimension array? How can I find the largest element in a column? How can I find the max difference between adjacent arrays? I started to write a function as below void average(float matrix[ROWS][COLS], int...
  10. kjb

    Proble solving - can someone help?

    Thanks for your reply. As I said, I am new to c programming. I have taught myself the basics in preparation for an exam but I have no clue how to tackle this problem. I know how to open an input file and am familiar with arrays. But need direction to get started on this. Could not find a...
  11. kjb

    Proble solving - can someone help?

    I am new to c programming. Could someone help me to solve the following problem related to arrays and text file: A company has a large number of text files. These files are organized as follows: 1. the first line contains a threshold value. 2. the second line specifies the number of rows in...

Part and Inventory Search

Back
Top