FOR LOOP QUESTION
1) Write a program to print first 20 numbers.
2) Write a program to print numbers from 25 to 1 in reverse order.
3) Write a program to print all the odd numbers from 20 to 50.
4) Write a program to print all the even numbers from 10 to 25.
5) Write a program to print all the three-digit positive numbers.
6) Write a program to enter five numbers and print the sum of all the odd numbers if any.
Answers
Answered by
2
Answer:
Shruti has displayed the entire text of her document in uppercase. Name the property she
must have used to achieve the same .
Answered by
1
Answer:
Explanation:
1=
Class sum
{
public void main ()
{
for(int i=1;i<=25;i++)
{
System.out.println(i)
}
}
}
2=
Class sum
{
public void main ()
{
for(int i=25;i>=1;i--)
{
System.out.println(i)
}
}
}
3=
Class sum
{
public void main ()
{
for(int i =21;i<=49;i+=2)
{
System.out.println(i)
}
}
}
4=
Class sum
{
public void main ()
{
for(int i=10;i<=24;i+=2)
{
System.out.println(i)
}
}
}
Similar questions