Current location - Training Enrollment Network - Mathematics courses - How to write arithmetic progression's C language program?
How to write arithmetic progression's C language program?
# include & ltstdio.h & gt

int main()

{

Dragon s; //The first item

Long d; //Tolerance

Dragon n; //Number of projects

Dragon me; //Used for cycle counting

Long-term temperature; //Used for temporary recording.

Printf ("Please enter the first item:");

scanf("%ld ",& amps);

Printf ("Please enter tolerance:");

scanf("%ld ",& ampd);

Printf ("Please enter the number of items:");

scanf("%ld ",& ampn);

Printf ("Display starts from the following: \ n");

for(i = 0,temp = s; I & ltn;; i++,temp += d)

{

printf("%ld ",temp);

}

printf(" \ n ");

Returns 0;

}

This is just a demonstration. I don't know what you want, do you?