+ 3
Why these codes giving error??
https://code.sololearn.com/cl0rhNPL6awB/?ref=app https://code.sololearn.com/c2A8VQUb6IHD/?ref=app
4 ответов
+ 7
Your Second code some errors i noticed
First one in line 4 you defined function
void permutation(char *s,int i,int n) here what u did . Here you gave definition but. You forget to put bracket after function name u should write like this
void permutation(char *s,int i,int n)
{
body you missed bracket
}
Second one in line 27 when u taking String input u used scanf here you used & address remove it its not required when u taking String input u can simply write
scanf("%s",str);
Your swap is showing undefined becoz so define it globally in header after headerfile.
Fix them your code will work
And you used forward slash in instead of backslash write \n not /n and try to figure errors.
+ 7
You Fibonacci series code is woRkiNg but u did mistake in line 6 in second expression u forget to call function it should be
fibo(n-2) u missed to call fibo so u were not getting proper series.
#include<stdio.h>
int fib(int n){
if(n==0||n==1)
return n;
return (fib(n-1)+fib(n-2));
}
int main() {
int i;
for(i=0;i<=10;i++)
printf("\n Fibonacci series %d",fib(i));
return 0;
}
+ 5
Thnx
+ 4
Aarti Rani welcome 😜