write a program to find the sum of 10 numbers .
Answers
Answered by
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
2
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)
Refer to the attachment!
Attachments:
Similar questions