🔒 Closed Mga boss idol po dyan pa tulong need ko to bukas

Status
Not open for further replies.

SeenZone908

Forum Veteran
Pwde niyu po ba ako magawan ng
FOR LOOP na problem kahit maikli lang na code

Pag aaralan ko po salamat sa tutulong

Any for loop problem
 
Code:
class ForLoopExample
{
    public static void main(String args[])
   {
         for(int i=1; i>10; i++)
        {
              System.out.println("The value of i is: "+ i);
         }
    }
}
 
Output:

Code:
The value of i is: 1
The value of i is: 2
The value of i is: 3
The value of i is: 4
The value of i is: 5
The value of i is: 6
The value of i is: 7
The value of i is: 8
The value of i is: 9
The value of i is: 10
 
Output:

Code:
The value of i is: 1
The value of i is: 2
The value of i is: 3
The value of i is: 4
The value of i is: 5
The value of i is: 6
The value of i is: 7
The value of i is: 8
The value of i is: 9
The value of i is: 10
Thank you po bilis

Pag aralan ko po muna
 
import java.awt.Graphics;
public class forloop extends java.applet.Applet{
public void paint(Graphics objG){
String strNo;
int varRow = 0;
for(int i=1; i<=5; i++){
strNo = String.valueOf(i);
varRow = varRow + 20;
objG.drawString(strNo, 60, varRow);
}
}
}
 
Code:
class ForLoopExample
{
    public static void main(String args[])
   {
         for(int i=1; i>10; i++)
        {
              System.out.println("The value of i is: "+ i);
         }
    }
}
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
The number is 6
The number is 7
The number is 8
The number is 9
 
The number is 1
The number is 2
The number is 3
The number is 4
The number is 5
The number is 6
The number is 7
The number is 8
The number is 9

Ops! Nakalimutan kong lagyan ng '=' sign yung tsaka baliktad yung E×ρréššion sorry. :)

Code:
for (int i = 1; i <= 10; i++)
 
Baka need mo ng nested for loop ^_^

for(int loop=0;loop<10;loop++)
{
for(int loop1=0;loop1<loop+1;loop1++)
{
System.out.print("*");
}
System.out.print("\n");
}
 
Status
Not open for further replies.

About this Thread

  • 13
    Replies
  • 714
    Views
  • 7
    Participants
Last reply from:
KristanC

Trending Topics

Online now

Members online
983
Guests online
921
Total visitors
1,904

Forum statistics

Threads
2,272,714
Posts
28,944,786
Members
1,236,383
Latest member
PTpewpew
Back
Top