write an algorithm for additiona of first n numbers
Answers
Answered by
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
Math,
30 days ago
Math,
30 days ago
Business Studies,
30 days ago
Music,
2 months ago
Environmental Sciences,
2 months ago
Math,
8 months ago
English,
8 months ago