WAP to accept numbers from the user, stop when user enters 0. Display sum of it.
Answers
Answered by
0
Answer:
I'm only writing main program with the help of java language...
//to input no.
int n =Integer.parseInt(br.readline());
int s=0;
while(true) // here it means infinite loop
{
//for sum
s=s+n;
if(n=0)
System.out.print(+s);
break; // it came out of loop
else
n=0; // this is to initialise the value as null.so,that user can again input any no. and then this value will overwrite...
}
HOPE IT WILL HELP YOU!
Similar questions
Hindi,
2 months ago
Math,
2 months ago
Geography,
5 months ago
Math,
1 year ago
Computer Science,
1 year ago