Computer Science, asked by sp7227730, 7 months ago

write a javascript programming to accept to any fifty number and print their sum?

please give the correct answer
who will give the correct answer he must be mark as brainliest and who will give the wrong answer he must be reported and his account will be banned​

Answers

Answered by anindyaadhikari13
2

Question:-

Write a JavaScript program to accept 50 numbers and print their sum.

Answer:-

This is a simple code. Check out the attachment. Output is given.

If you are talking about Java, write this code.

import java.util.*;

class Sum

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

int s=0;

for(int i=1;i<=50;i++)

{

System.out.print("Please Enter a number: ");

s+=sc.nextInt();

}

System.out.println("Sum is: "+s);

}

}

Attachments:
Answered by 387shahdrashti
0

Answer:

I want free point......

Similar questions