P057.c (574B)
1 /* WAP to display the series using user defined method. 2 0, 7, 26, 63, ... upto n terms using void series(int n) 3 */ 4 5 // This code has not been compiled. 6 // If you find any issues, please create a new issue on GitHub regarding them. 7 // Go to this link to create a new issue: https://github.com/notamitgamer/bsc/issues 8 9 #include <stdio.h> 10 11 void series(int n) 12 { 13 int i; 14 printf("\nSeries: "); 15 for (i = 1; i <= n; i++) 16 printf("%d ", (i * i * i) - 1); 17 } 18 19 int main() 20 { 21 int n; 22 printf("Enter n: "); 23 scanf("%d", &n); 24 series(n); 25 return 0; 26 }