Computer Science, asked by V7ASHWILD, 5 months ago

write a program to accept any ten values and find its sum.

Answers

Answered by valeriy69
2

\small\mathsf\color{pink}{Solution\: using\: python\: 3}

values = input("enter nums: ").split()

int_values = [int(n) for n in values]

print(f"sum: {sum(int_values)}")

\small\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by anindyaadhikari13
1

Question:-

Write a program to accept 10 values and display it's sum.

Program:-

This is written in Java.

import java.util.*;

class Sum

{

static void main()

{

Scanner sc=new Scanner(System.in);

int s=0;

System.out.println("Enter 10 numbers... ");

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

s+=sc.nextInt();

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

}

}

Similar questions