import java.applet.Applet;
import java.awt.*;
public class tableof10 extends Applet {
int count,i;
public void init(){
this.count=10;
}
public void paint(Graphics g) {
for(i=1;i<=10;i++)
{
g.drawString(i+ "* 10 =" +i*10,150,count);
count=count+20;
}
}
}
Applet code:
<html>
<head>
<title>table of 10</title>
</head>
<body>
<applet code="tableof10.class" height="500" width="500"></applet>
</body>
</html>
OUTPUT:
import java.awt.*;
public class tableof10 extends Applet {
int count,i;
public void init(){
this.count=10;
}
public void paint(Graphics g) {
for(i=1;i<=10;i++)
{
g.drawString(i+ "* 10 =" +i*10,150,count);
count=count+20;
}
}
}
Applet code:
<html>
<head>
<title>table of 10</title>
</head>
<body>
<applet code="tableof10.class" height="500" width="500"></applet>
</body>
</html>
OUTPUT:
Hello Pranab....1*10=10 is not getting printed how to print this..please help.
ReplyDeleteregards
Dipankar
i updated the codes.
Deleteplz try with recent codes...
Write a program in Java to create an applet which generates the table of a given
ReplyDeletenumber between 1-10. If number entered is not in this range ask the user to input the
number again and if input number is zero exit from the program.