Problem description
Create a program that outputs the sum of the numbers 1 to 40.
Answers
Answered by
1
Answer:
class abc
{
void display ( )
{
int s=0;
for ( int x=1;x<=40;x++)
{
s=s+x;
}
System.out.println(s);
}
}
Explanation:
MARK ME AS THE BRAINLIEST
Similar questions
Math,
3 months ago
Psychology,
3 months ago
Math,
7 months ago
Math,
7 months ago
Science,
1 year ago
Accountancy,
1 year ago
Accountancy,
1 year ago