Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int n;
- float ciag(int n){
- if(n==0){
- return 0;
- }
- if(n==1){
- return 0.5;
- }
- else{
- n=ciag(n-1)-(2*ciag(n-2));
- return n;
- }
- }
- int main(int argc, char *argv[])
- {
- ciag(2);
- printf("%0.2f\n",ciag(2));
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement