projects
/
my-code
/
beginners.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
added matrix_mult.c file - matrix multiplication without fields and with use of amllo...
[my-code/beginners.git]
/
fehler.c
1
#include <stdio.h>
2
#include <math.h>
3
4
#define VARIABLEN_TYP double
5
#define MAX_ 40
6
7
main()
8
{
9
VARIABLEN_TYP erg, x1, x2;
10
int i;
11
12
x1=30;
13
x2=25;
14
15
printf("1 Ergebnis: 30");
16
printf("2 Ergebnis: 25");
17
18
for (i=3;i<=MAX_;++i)
19
{
20
printf("%02d. Ergebnis: %08.2f\texakt: %f\n",i,erg=(-13*x2/6)+(5*x1/2),36.*pow((5./6),i));
21
x1=x2;
22
x2=erg;
23
}
24
}