write a program in java to find the sum of odd numbers 1 to 50
Answers
Answered by
4
Explanation:
class Calculation
{
void input ( )
{
int s = 0, i ;
for ( i = 1 ; i < = 50 ; i = i + 2)
{
while ( i/2 != 0)
{
s = s + i ;
}
}
System.out.println( " The sum of the numbers is " + s) ;
}
}
I HOPE THIS ANSWER WILL HELP YOU AND PLEASE MARK THIS ANSWER THE BRAINLIEST ONE...
Similar questions
Math,
5 months ago
Science,
5 months ago
English,
9 months ago
Computer Science,
1 year ago
Biology,
1 year ago