1. you are absolutely right! should I change every loop to the following:

Code:
```for(n = 0; n < 1; n++)
{
char s[32];
sprintf(s, "&#37;.1f", ((maxx-minx)/5)*n);
Putstr(13, 14, s);
}```

2. Thanks for giving me credit, but I would actually say Salem is absolutely right and you should simply change max = maxx-min;

3. I said absolutely right to you because you said that I should make the last code on my on. But my code works ABSOLUTELY right now:
Code:
```#include <stdio.h>
#include <string.h>

char xText[] = "Tid(sek)";
char yText[] = "Temp(C)";

char a[16][45] =
{
{"                                             "},
{"                                             "},
{"              ^                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              |                              "},
{"              +---|---|---|---|---|->        "},
{"                                             "},
{"                                             "}
};

void Putstr(int x, int y, const char* s)
{
int i;
for(i = 0; s[i]; i++)
a[y][x + i] = s[i];
}
void Putstr1(int x, int y, const char* s)
{
int i;
for(i = 0; s[i]; i++)
a[x][y + i] = s[i];
}

int main()
{
int l, i;
double minx;
double maxx;
double miny;
double maxy;
int n;

printf("Minimums og maksimums v&#230;rdi p&#229; x-aksen: ");
fflush(stdout);
scanf("&#37;lf, %lf", &minx, &maxx);
printf("Minimums og maksimums v&#230;rdi p&#229; y-aksen: ");
fflush(stdout);
scanf("%lf, %lf", &miny, &maxy);

for(n = 0; n < 1; n++)
{
char s[32];
sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(13, 14, s);
}

for(n = 1; n < 2; n++)
{
char t[32];
sprintf(t, "%.1f", ((maxx-minx)/5)*n);
Putstr(17, 15, t);
}
for(n = 2; n < 3; n++)
{
char u[32];
sprintf(u, "%.1f", ((maxx-minx)/5)*n);
Putstr(21, 14, u);
}
for(n = 3; n < 4; n++)
{
char v[32];
sprintf(v, "%.1f", ((maxx-minx)/5)*n);
Putstr(24, 15, v);
}
for(n = 4; n < 5; n++)
{
char b[32];
sprintf(b, "%.1f", ((maxx-minx)/5)*n);
Putstr(29, 14, b);
}
for(n = 5; n < 6; n++)
{
char d[32];
sprintf(d, "%.1f", ((maxx-minx)/5)*n);
Putstr(32, 15, d);
}

for(n = 0; n < 1; n++)
{
char e[32];
sprintf(e, "%.f", ((maxy-miny)/5)*n);
Putstr(11, 13, e);
}
for(n = 1; n < 2; n++)
{
char r[32];
sprintf(r, "%.1f", ((maxy-miny)/5)*n);
Putstr(8, 11, r);
}
for(n = 2; n < 3; n++)
{
char g[32];
sprintf(g, "%.1f", ((maxy-miny)/5)*n);
Putstr(8, 9, g);
}
for(n = 3; n < 4; n++)
{
char f[32];
sprintf(f, "%.1f", ((maxy-miny)/5)*n);
Putstr(8, 7, f);
}
for(n = 4; n < 5; n++)
{
char h[32];
sprintf(h, "%.1f", ((maxy-miny)/5)*n);
Putstr(8, 5, h);
}
for(n = 5; n < 6; n++)
{
char m[32];
sprintf(m, "%.1f", ((maxy-miny)/5)*n);
Putstr(7, 3, m);
}

memcpy(a[1] + 10, yText, strlen(yText));
memcpy(a[13] + 45 - strlen(xText), xText, strlen(xText));

for(l = 0; l < 16; l++,printf("\n"))for(i=0; i<45; i++)
{
printf("%c", a[l][i]);
}

return 0;
}```
Thank you BOTH guys for this help. Iam really grateful

4. You are welcome, but I would feel embarassed to say I feel like I helped you while you still have those nasty loops in your code

5. Yes I think they really fills the space. I've tried to look a bit in my book about how to make them smaller, but I could not find anything. And since I am new to the profession, I have made the loops as easy as possible

6. You know that the vertical ticks are every 2 spaces and the horizontal spaces are every 4 spaces and vary by one vertical unit up or down. So why not utilize these facts and write a separate function.

7. I think I'm not quite with. But it is something like:

Code:
```int n;
for(n = 0; n < 6; n++)
{
char s[32];
sprintf(s, "%lf", max*n/6)
PutStr(13 + 4*n, 14, s)
}```

8. > I think I'm not quite with. But it is something like:
Absolutely!
It's just a matter of working out the expression which positions the output in a regular pattern.

9. Can I do It like this:

Code:
```for(n = 0; n < 6; n++)
{
char s[32];

sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(13, 14, s);

sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(17, 15, s);

sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(21, 14, s);

sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(24, 15, s);

sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(29, 14, s);

sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(32, 15, s);
}```

10. Since you write 6 things each time through the loop, which runs six times (0,1,2,3,4,5) you will write 6*6=36 labels. Since you want 6 labels, and the loop runs six times, you need to print *1* thing inside the loop.

11. Code:
```sprintf("&#37;.1f", ((maxx-minx)/5*n)
Putstr(13, 14, *1*)```
Or am I completely wrong??

12. Originally Posted by aslak
Code:
```sprintf("%.1f", ((maxx-minx)/5*n)
Putstr(13, 14, *1*)```
Or am I completely wrong??
Yes. I was being emphatic -- 1 thing, not the actual number 1 with stars on it. And also you need to move the thing around -- if you write all six labels in the same place, well you won't see them all.

13. For the x-axe, I have this loop:

Code:
```for(n = 0; n < 6; n++)
{
char s[32];
sprintf(s, "&#37;.1f", ((maxx-minx)/5)*n);
Putstr(13 + 4*n, 14 + (n % 2), s);
}```
But for the y-axe, I cant understand how the loop is going to be.

14. Originally Posted by aslak
For the x-axe, I have this loop:

Code:
```for(n = 0; n < 6; n++)
{
char s[32];
sprintf(s, "%.1f", ((maxx-minx)/5)*n);
Putstr(13 + 4*n, 14 + (n % 2), s);
}```
But for the y-axe, I cant understand how the loop is going to be.
Why do you think it will be different? Change maxx to maxy, minx to miny, switch the Putstr around so you're going up instead of over, and you're done.

15. when I try to plot this, i do not see anything at the coodinatesystem:

Code:
```for(n = 0; n < 6; n++)
{
char s[32];
sprintf(s, "&#37;.1f", ((maxy-miny)/5)*n);
Putstr(13 + 4*n, 14 + (n % 2), s);
}```
I want it to be different because I want the y-axe to be like this: 0 (and not 0.0) , 20.0 , 40.0 , 60.0 , 80.0 , 100.0.