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