Computer Science, asked by shreyanshmishra121, 2 months ago

write a program to find the sum of 10 numbers .​

Answers

Answered by aayushisingh05
0

Answer:

class Sum

{ void main()

{ Scanner sc = new Scanner (System.in)

int n,s,i;

for (i=1;i≤10;i++)

{System.out.println("enter any no.");

n= sc.nextInt();

s=s+n;

}

System.out.println("sum of 10 no="+s);

}

}

Answered by Anonymous
2

\underline{\fbox{\sf\red{Program}}}

num1 = 10

num2 = 10

num3 = 10

num4 = 10

num5 = 13

num6 = 12

num7 = 9

num8 = 11

num9 = 5

num10 = 3

sum = num1 + num2 + num3 + num4 + num5 + num6 + num7 + num8 + num9 + num10

print(num1,"+",num2,"+",num3,"+",num4,"+",num5,"+",num6,"+",num7,"+",num8,"+",num9,"+",num10,"=",sum)

\underline{\fbox{\sf\red{Output}}}

Refer to the attachment!

Attachments:
Similar questions