World Languages, asked by vaishnavigaikwad082, 2 months ago

write an algorithm for additiona of first n numbers​

Answers

Answered by nirmitmodh23
0

Answer:

Without Using Loop – Using Formula:

main()

int num, sum;

printf("\n Enter the number: ");

scanf("%d",&num);

sum = num*(num+1)/2;

printf("\n\n The sum of natural number is: %d\n ", sum);

Similar questions