Line 3: Line 3:
 
<syntaxhighlight lang="c">
 
<syntaxhighlight lang="c">
 
#include<stdio.h>
 
#include<stdio.h>
int main()
+
int fib(int n){
{
+
if(n<=2)return 1;
    char str[] = {'a','b','c','\0'};
+
else return fib(n-1)+fib(n-2);
    str[0] -= 32;
+
}
    printf("%s",str);
+
main(){
 
+
int n;
    return 0;
+
printf("enter the number ");
 +
scanf("%d",&n);
 +
printf("fib(%d)=%d",n,fib(n));
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 12:16, 26 May 2014

<quiz display="simple"> { What is the output of the following program? <syntaxhighlight lang="c">

  1. include<stdio.h>

int fib(int n){ if(n<=2)return 1; else return fib(n-1)+fib(n-2); } main(){ int n; printf("enter the number "); scanf("%d",&n); printf("fib(%d)=%d",n,fib(n)); } </syntaxhighlight> |type="{}" /} { Abc }


</quiz>

<quiz display="simple"> { What is the output of the following program? <syntaxhighlight lang="c">

  1. include<stdio.h>

int fib(int n){ if(n<=2)return 1; else return fib(n-1)+fib(n-2); } main(){ int n; printf("enter the number "); scanf("%d",&n); printf("fib(%d)=%d",n,fib(n)); } </syntaxhighlight> |type="{}" /} { Abc }


</quiz>