write a program to display the sum of any "n" natural numbers (using for loop)
Answers
Answered by
3
For 10 Natural Numbers :-
In Java
for(int n = 0 ; n < 10 ; n++){
n = n + n;
System.Out.Println(n);
}
Note :- Not Sure Please Check And Let Me Know Also Actually I Didnt Test And I Work In Almost 12 Programming Languages So It Gets Confusing Sometime
In Java
for(int n = 0 ; n < 10 ; n++){
n = n + n;
System.Out.Println(n);
}
Note :- Not Sure Please Check And Let Me Know Also Actually I Didnt Test And I Work In Almost 12 Programming Languages So It Gets Confusing Sometime
Similar questions