C language Find 1 2 2 3 3 4 n 1 n and practice questions

Mondo Education Updated on 2024-01-30

100 help plan

Find 1 2 + 2 3 + 3 4 + ......n-1 n's and.

As shown in Fig

4……You can use (i i+1).

2. Set up a function to find the sum of the sums of numbers.

#include

int main()

int num;

printf("Enter a number:");

scanf("%d",&num);

Call the [Fraction Sequence and] function.

fenshuxuliehe(num);

Set the [Fraction Sequence Sum] function to calculate and print the sum.

fenshuxuliehe(int num)

float count=0;Sum variables.

Count the sum. for(int i=2; i<=num; i++)

According to 1 2 + 2 3 + 3 4 ......=.

if(num<=4)

Related Pages