Create a java script program using for-loop to calculate the sum of first 10 odd no. s
Answers
Answered by
2
class ab
{
public static void main (String arg [])
{
int i;
for(i=1;i<=20;i++))
{
if((i%2==1)
System.out.print(i+"," ) ;
}
}
}
{
public static void main (String arg [])
{
int i;
for(i=1;i<=20;i++))
{
if((i%2==1)
System.out.print(i+"," ) ;
}
}
}
Similar questions
English,
5 months ago
Psychology,
10 months ago
Science,
11 months ago
Hindi,
11 months ago
English,
11 months ago