write an algorithm to print the sum of first 10 natural number
Answers
Answered by
0
Answer:
10
Explanation:
Answered by
0
Answer:
Print the first ten natural numbers.
here is my whole algorithm.
An algorithm is just a set of instructions. Since you didn’t specify a language, I used “natural English” and assumed you were sophisticated enough to be able to follow the fairly high level set of terms and parse them successfully.
If you want something more simple, try this:
Our number is zero
Add one to our number
Print our number
If our number is more than ten, stop
Add one to our number
Go back to the second step
PROGRAMME
#include <stdio.h>
int main()
{
int i,n=10;
for(i=1; i<=n; i++)
{
printf("%d\n",i);
}
return 0;
}
Similar questions