A retired man has $800000 invested at 8% annual rate. He would like to be able to take a certain amount of money once a year during 24 years until all the money is gone.
Use any language to write a program to calculate the amount of money he will be getting annually.
Answers & follow ups
Write a function to reverse the words in the sentence, for example
"This is a string " becomes "string a is This". The memory
is limited. You can't use another string for replacement .
Answers & follow ups
How would you write a program to search a file on a hard drive ?
Answers & follow ups
Reverse linked list.
Answers & follow ups
There is a sequence of random integers, for example 36, 7, -2, 0 ...
Within this sequence you need to find a subsequence with the biggest sum of the numbers?
Answers & follow ups
What do you think can be wrong with this function?
What will be the result of the following code?
void foo(void)
{
unsigned int a=6;
int b=-20;
(a+b >6) ? puts(">6") : puts("<=6");
}
Answers & follow ups
What operation will take longer time:
- to add two bytes
- to add two floats
- to add byte and float ?
Answers & follow ups
A function returning free disk space used to work for years. Problems started after the hard drive was upgraded.
The structure of the program is as following:
int free_space (hard drive)
{
...
}
What would be your approach?