Make an algorithm which calculates the sum of n numbers using the cycle:
a) for{}
b) while{}
d0 while{}.
C++:
int sum = 0;
for (int i = 1; i <= n; ++i)
sum += i;
Return to Programming and Algorithms
Users browsing this forum: No registered users and 0 guests