Write a program to print the sum of first ten natural numbers
Answers
Answered by
1
Answer:
55
Explanation:
# The program is written in Python
sum = 0
for i in range(1,11):
sum += i
print(sum)
Answered by
1
Answer:
java
class sum{
public static void main(String[] args) {
int sum=0;
for(int i=1; i<=10; i++)
sum+=i;
System.out.println(sum);
}
}
python
sum=0
for i in range(1,11):
sum+=i
print(i)
Mark as brainliest
Similar questions