1896 Shares

Topic: **Problem solving using c programming****Question:**
include
#define NROWS 2
#define NCOLS 2
void norm_2D(double x[NROWS][NCOLS]);
int main()
{
int i, j, k;
double x[NROWS][NCOLS];
int *ptr=&x[0][0];
double minx = x[0][0];
double maxx = x[0][0];
//Entering values for each element of array//
for(i=0; i *(ptr+k))
minx = *(ptr+k);
//Finding the maximum value of array x//
for(k=0; k<=4; k++)
if(maxx < *(ptr+k))
maxx = *(ptr+k);
//Normalizing each element of array//
for(i=0; i

July 17, 2019 / By Artur

1) you need a pounds sign before the includes. 2) since x is an array of doubles, ptr needs to be a double *. 3) All the rest of your problems are caused by the norm_2D function. The function parameter is screwed up. double x[int i][int j] doesn't make any sense. Looking at the other declarations and the call its self, it is probably supposed to be void norm_2D(double x[NROWS][NCOLS]); 4) The body of norm_2D doesn't make any sense either. First, you call it with norm_2D(x[i][j]); which would pass in a double, but the rest of the program seems to show that you should be passing a 2d array. Also, is there a reason you have double nested for loops before you call it then again in the body of the loop? Also minx and maxx aren't ever declared within the function body. That function body needs a lot of work.

👍 96 | 👎 4

Did you like the answer? We found more questions related to the topic: **Problem solving using c programming**

From what I see there are a couple of errors. 1. run should change value after "if" if(run == 1) { max = gpa; min = gpa; } 2. you should have a stud_max and stud_min variable so don't get same student max and min 3. you should calculate average out of the "for" loop 4. printf("\nAverage GPA = %.0f", average_gpa); should be printf("\nAverage GPA = %.1f", average_gpa); to get the average's decimal point I fixed that for you and now it works ;-) : #include

Hm.... the challenge is: After u declare minValue or maxValue, it would properly be random fee, rely u r compiler. celebration, if compiler says: minValue = lowest fee of double and if compiler says: maxValue = maximum fee of double - seem at form of double. U have trojan horse issues! fix with: make certain minValue and maxValue as first fee of array: double minValue = x[0]; double maxValue = x[0]; After this: for (i=a million; i

8.) Solve the system of equations. 4x+5y=3 2x+y=0 --> x=-.5; y= 1; 9.) A possible step toward solving these equations by addition could be : 4y-6x=11 -8x-4y=13 --> -14x = 24 10.) Given the coordinate points A(2,4), C(3,6), and F(4,8), which equation proves that point C lies on the line AF? --> d(A,C)+d(C,F)=d(A,F) 11.) From this trinomial you can deduce that: x to the second power - 6x + 9=0 --> x = 3 12.) Factor the polynomial completely. --> 49s+7rs - 21 - 3r = 7s(7+r) - 3(7+r) = (7s-3)(7+r) 13.) Factor completely. 12x^2 +13x +3 = (4x+3)(3x+1)

a million. gas weights 0.69g/cm^3. If a automobile has 40 L gas tank, how plenty greater advantageous weight, in kilograms, is the automobile pulling while the gas tank is completed? by way of fact that a million Liter is a million,000 cm^3, One Liter of gas weights 690 grams or 0.sixty 9 kilograms. 40 L is 27.6 kilograms 2. A race automobile reaches a velocity of one hundred sixty miles in keeping with hour. what's the fee of velocity in keeping with minute? one hundred sixty miles in keeping with hour x ( one hour/60 minutes) = 2.sixty seven miles in keeping with minute 3. A 12 foot ladder is 12 foot x (12 inches in keeping with foot) = one hundred forty four inches. A 12 foot ladder is in simple terms too short.

If you have your own answer to the question problem solving using c programming, then you can write your own version, using the form below for an extended answer.