Computer Science, asked by deepudg73, 4 months ago

Problem description
Create a program that outputs the sum of the numbers 1 to 40.

Answers

Answered by manpreet0409
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