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...
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
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...
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...
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...
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...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.