And you can define your own data types with typedef
Deleted:
< <
Assignements
Changed:
< <
We modify the program to do some calculation:
> >
We modify the program to do some calculation:
Calculating the Fibonacci numbers
The Fibonacci numbers:
0 1 1 2 3 5 8 13 21 34 …
or xn = xn-1+xn-2
How can we write a program to calculate up to 12 such numbers?
This can easily be done in a for loop
The for loop
The while loop
Can we also do calculations as long as the Fibonacci number
does not exceed a certain value?
Pointers
We can define variables which do not contain the value but
the address of where the value is stored in memory:
char a=5; is the value
char *myText=”Hello World!”;
myText points to the place in memory where Hello World is stored.