1.

Write a C program that generates the following series. 1, -23, -45, -67, -89, -10

Answer» INT main() { int a=1,b=3,c=4,d,i,N; SCANF("%d",&n); PRINTF("%d %d %d ",a,b,c); for(i=4;i<=n;i++) { d=a+b+c; printf("%d ",d); a=b;  b=c; c=d; } RETURN(0); }


Discussion

No Comment Found