#include <stdio.h>#include <stdlib.h>int sum(int n){ int k=0; if(n==1)return 1; k=n+sum(n-1); return k;}void main(int argc,char *argv[]){ int n; FILE *fp; if(argc!=2) { printf("\nToo few parameter"); exit(0); } printf("\nEnter a integer number:(>0)"); scanf("%d",&n); fp=fopen(argv[1],"w"); printf("sum(n)=%d",sum(n)); fprintf(fp,"sum(n)=%d",sum(n)); fclose(fp);}