Java code to find sum of 100 positive integers using 1 variable.
Answers
Answered by
3
Answer:
Using Java while Loop
public class SumOfNaturalNumber2.
{
public static void main(String[] args)
{
int num = 100, i = 1, sum = 0;
//executes until the condition returns true.
while(i <= num)
{
Answered by
1
Answer:
int num = 100, i = 1, sum = 0;
Step-by-step explanation:
try it
hope its right
have a good day :)
Similar questions