No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
- Interests
- gaming computing coding,hacking
- PC Specs
- 2.27 ghz,2gb ram,512 geforce 8400gs...
error in ma program it shows the last digit twice. #include<conio.h> #include<stdio.h> int main() { int fib(int); int n,c,a=0,b=1; printf("enter a number: "); scanf("%d",&n); printf("%d %d ",a,b); c=fib(n); printf("%d ",c); getch(); } int fib(int n) { int a=0,i,b=1,sum; for(i=0;i<n-2;i++) { sum=a+b; a=b; b=sum; printf("%d ",sum); } return(sum); } |
|
Re:
This is the code do look at it. I just want change it in switch statement. will stuck in it. it is unix code. commands[0] = (char *)"ls"; params[0] = (char*)0; commands[1] = (char *)"who"; params[1] = (char*)0; commands[2] = (char *)"date"; params[2] = (char*)"+%d/%m/%y"; commands[3] = (char *)"ps"; params[3] … |