write a program in java to find the sum of the first ten natural number
Answers
Answered by
1
Explanation:
(I am using default package)
class Natural {
void main ( ) {
double S = 0.0 ;
int i ;
for (i = 1 ; i <= 10 ; i++)
S = S + i ;
System.out.print ("S");
}}
Similar questions
Computer Science,
2 months ago
Social Sciences,
2 months ago
Social Sciences,
2 months ago
Physics,
5 months ago
English,
5 months ago
Computer Science,
11 months ago
Hindi,
11 months ago