Forum : Can you please tell me whats the problem with the code
Brief description  about Online courses   join in Online courses
View ashish  sinha 's Profile

Can you please tell me whats the problem with the code

<html>
<head>
<title>assignment 5</title>
<script type="text/javascript">

function nine()
{
var d= new Date();
var i=d.getDay()
switch(i)
{
case 0: alert("Today is Sunday...");
break;
case 1: alert("Today is Monday...");
break;
case 2: alert("Today is Tuesday...");
break;
case 3: alert("Today is Wednesday...");
break;
case 4: alert("Today is Thursday...");
break;
case 5: alert("Today is Friday...");
break;
case 6: alert("Today is Saturday...");
break;
}
}



function four(str)
{
var k=0;
for(i=0;i<str.length-1;i )
{
for(j=i 1;j<str.length;j )
{
if((str[i]==str[j]))
{
str=str.replace(str[i],"#");
str=str.replace(str[j],"#");
}
}
}

for(i=0;i<str.length;i )
{
if(str[i]!='#')
k ;
}
document.form1.txt3.value=k;
}



function six()
{
x=document.form1.txt4.value;

for(i=0;i<2x;i )
{
while(i<x)
{
for(j=0;j<=i;j )
document.write(j "
Asked by ashish sinha | Sep 27, 2010 |  Reply now
Replies (3)
View ashish sinha 's Profile
function six()
{
x=document.form1.txt4.value;

for(i=0;i<2x;i++)
{
while(i<x)
{
for(j=1;j<=i;j++)
document.write(j+ "&nbsp;&nbsp;");
document.write("<br/>");
}
}
for(i=x;i>0;i--)
{
for(j=1;j<=i;j++)
document.write(j+ "&nbsp;&nbsp;");
document.write("<br/>");

}

}
Oct 6, 2010
View ashish sinha 's Profile
Dear Sir,
I have submitted the whole asignment, I succeeded in printing the numbers on that fashion, but once i made a change i failed to make it work again, pleae check the function six() from the loop assignment submitted, I have kept it as a comment for now. Please help
Oct 1, 2010
View teacher siliconindia 's Profile
Hi Asish,

Paste the full code for function six()...
Sep 28, 2010