# I need very fast help, like within the hour, please!

Show 50 post(s) from this thread on one page
Page 2 of 5 First 12345 Last
• January 16th, 2013, 08:40 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Before the loop.
int nTotal = 0;

Inside the loop
nTotal += maatriks[i][2]);
• January 16th, 2013, 08:43 AM
Re: I need very fast help, like within the hour, please!
question what exactly does "n total" mean and do? never heard of anything like that before

EDIT, i tryed to add what u said in... but for some reason now when i activate the program, everything broke down int o massive ENDLESS ammount of numbers? so i dont know what to do agian :(
well alteast i THINK i did it as u said....
• January 16th, 2013, 08:47 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote:

question what exactly does "n total" mean and do? never heard of anything like that before

There's no space between n and total.
• January 16th, 2013, 08:55 AM
Re: I need very fast help, like within the hour, please!
question what exactly does "n total" mean and do? never heard of anything like that before :( i think i am doing something wrong

i put the int nTotal = 0; to the top where i declare all my other stuff like int i,j;

and then nTotal += maatriks[i][3]); inside one of the loops? wow i just relized it is probably hard for you to understand half of my code because a lot of the words are written in first language
• January 16th, 2013, 08:59 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Which part of there is no space between n and total was unclear?
• January 16th, 2013, 09:05 AM
Re: I need very fast help, like within the hour, please!
ou sorry, the first sentance of my second post somehow came along with my last one,

i corrected the space but i still coulnt get it work, i think i am putting the nTotal += maatriks[i][3]); in the wrong place maybe? Where exactly in the code am i suppose to put it, the endless numbers stoped with the N fixing, but now simply nothing happens when i add that part? i must be doing something really wrong.
• January 16th, 2013, 09:06 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote:

ou sorry, the first sentance of my second post somehow came along with my last one,

i corrected the space but i still coulnt get it work, i think i am putting the nTotal += maatriks[i][3]); in the wrong place maybe? Where exactly in the code am i suppose to put it, the endless numbers stoped with the N fixing, but now simply nothing happens when i add that part? i must be doing something really wrong.

Let's see what you have. If your instructor is right there, can you ask him/her?
• January 16th, 2013, 09:07 AM
Re: I need very fast help, like within the hour, please!
i think i put it in the loop.....(if i understand correctly what loop means..... it is an english word that i have never heard before, my programming is taught to me in my own language so i am trying really hard to get to the right place)
• January 16th, 2013, 09:09 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote:

i think i put it in the loop.....(if i understand correctly what loop means..... it is an english word that i have never heard before, my programming is taught to me in my own language so i am trying really hard to get to the right place)

• January 16th, 2013, 09:11 AM
Re: I need very fast help, like within the hour, please!
lol i wish, i can ask but they wont answer, as i said "i have to do it myself by any way i can find out how or feagure out how, he simply wont tell me how, so he isnt an option to find out form"

also a LOT of the code is right now overlaping itself cuz i leave in every single thing i learned right now and once i get something done i delete out the crap. If anything is ununderstandebe because estonian i can translate most

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#define RIDU 4
#define VEERGE 7
#define MAX 150
#define MIN 10

int main (void)

{

int maatriks [RIDU] [VEERGE];
int i,j;
int nTotal = 0;

srand(time(NULL));

for(i=0; i<RIDU; i++)

{
for(j=0; j<VEERGE; j++)
{

maatriks[i][j]=rand()%(MAX-MIN)+MIN;
}
}

printf("Genereeritud matrix on:\n\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
printf("%4d", maatriks[i][j]);
}
printf("\n\n");
}

printf("========================================\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{

if (j>2) printf("%4d", maatriks[i][j]);
}
printf("\n");
}
printf("========================================\n");

printf("neljas tulp ja selle arvude summad\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
(nTotal += maatriks[i][3]);
if (j<1) printf("%4d", maatriks[i][3]);
}
printf("\n");
}
printf("----------------------------------------\n");

printf("viies tulp ja selle arvude summad\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j<1) printf("%4d", maatriks[i][4]);
}
printf("\n");
}
printf("----------------------------------------\n");

printf("kuues tulp ja selle arvude summad\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{
if (j<1) printf("%4d", maatriks[i][5]);
}
printf("\n");
}
printf("----------------------------------------\n");

printf("kuues tulp ja selle arvude summad\n");

for(i=0; i<RIDU; i++)
{
for(j=0; j<VEERGE; j++)
{

if (j<1) printf("%4d", maatriks[i][6]);
}
printf("\n");
}
printf("----------------------------------------\n");

printf("\n\n\n\n");

printf("Neljas tulp ja selle arvude summad\n");

j = 3;
for(i=0; i<RIDU; i++)
{

printf(" %4d", maatriks[i][j]);

}
printf("\n");

return 0;
}
• January 16th, 2013, 09:11 AM
Re: I need very fast help, like within the hour, please!
i would use that speical box you guys use to put the code in, but i dont know how u guys get it
• January 16th, 2013, 09:17 AM
GCDEF
Re: I need very fast help, like within the hour, please!
You've been told several times you don't need a loop that increments the column variable. You've also been told several times that to access the third column, the index should be 2, not 3.

This is what your summing loop should look like.

Code:

```for(i=0; i<RIDU; i++) {     nTotal += maatriks[i][2]; }```
• January 16th, 2013, 09:19 AM
Re: I need very fast help, like within the hour, please!
I dont need the third colum ( i need 4,5,6,7) i think i transalted that question in the start a bit wrong.

And about the loop i dont really understand what that word means so i mix and matched things...
• January 16th, 2013, 09:23 AM
Re: I need very fast help, like within the hour, please!
so how do u get it on scr
• January 16th, 2013, 09:24 AM
GCDEF
Re: I need very fast help, like within the hour, please!
Quote: