Monday, 8 July 2013

Logic foundation by using for loop

Authour:I will teach you courses online

C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:919703619391 E-mail: vas.shrinivas002@gmail.com
Hi

Freinds  i am getting mails stating that i like your way of explanation, people added me in their fav list. day by day i am getting more likes.

Few days back one of my viewer  greet me. Congrats one of your content selected by software GAINT microsoft.Content is

http://javascriptwithshrinivas.blogspot.com/2013/05/how-to-implement-sorting.html

Thanks  to viewers and respectable citizens of whole nations.


next is

print even numbers




<html>
<body>
<script type="text/javascript">

var lenin;

document.write("Even numbers"+ " ");

for(lenin=2; lenin<=16;lenin=lenin+2)

{
document.write(lenin+ " ");
}

</script>

</body>

</html>



explanation 

I took variable lenin and assigned 2 in that like lenin=2

dear you now that by adding 2 to previous number you can get even number
like this lenin=lenin[previous number]+2---------> [lenin=2+2] now 4


so on

6 8 10 12 14 16


next follow below
http://javascriptwithshrinivas.blogspot.com/2013/07/advanced-techniques-for-codeing.html

Saturday, 6 July 2013

more on logic using for loop


Authour:I will teach you courses online
C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:919703619391 E-mail: vas.shrinivas002@gmail.com
We want like this
1
1 1
1 1 1
1 1 1 1
1 1 1 1 1

Few days back I  brought vegetables.
My son is playing with tomatoes; he asked what these dad are. I replied to him tomatoes he said ohhh tomato

At that moment I have given tomatoes like this, and he arranged very neatly.

First time I given one tomato
Second time two tomatoes
Third time three tomatoes
Fourth time four tomatoes
Fifth time five tomatoes



he arranged like below




Logic is below

Copy start from below 

<html>
<body>

<script type="text/javascript">

var dad,son;

for(dad=1;dad<=5;dad++)
           
             {

                       for(son=1; son<=dad;son++)

                                  {
                                   
                          document.write("1");
                                  }

                            document.write("<BR>");
}



</script>

</body>
</html>

-----------------------copy ends above--------------------------------------------------
Understand this:

dad condition is 5 [dad<=5] rounds, for every round dad will increase

son listen dad voice he did not ask more tomatoes so son condition is[son<=dad]


Starts from hear:


First time dad given one tomato like this [dad=1;dad<=5]

above dad variable contains 1 tomato [assume in dad hand 1 tomato and condition is satisfied 1<=5]

now dad  put 1 tomato in son hand 

now sun part

now sun variable  contains 1 tomato

becz he listen dad voice like this son<=dad[1<=1]

in first row he put tomato on floor like this 

row 1--->.


next second round

dad variable contains 2 tomatoes why dad++[dad incremented, dad taken two tomatoes second round]

and condition satisfied dad<=5[2<=5]

now son part

dad given first tomato for second row

sun variable contains 1 tomato in his hand [sun=1]
and condition is satisfied 1<=dad[1<=2]

row 2---->.

 next son++[son incremented] son excepted second tomato
 taken second tomato from father, condition is satisfied son<=dad[2<=2]

he put second tomato on floor now row 2 contains two tomatoes
  

row 2---->..

like that sun continued 

Third time three tomatoes
Fourth time four tomatoes
Fifth time five tomatoes

like that son arranged see how sweetly he arranged

in place of tomato you can assume 1

now output is 

1
11
111
1111
11111

------------------------THANK YOU FOR ALL----------------------------------------

This time i am expecting child[son],He is womb of her mother. Please bless me.



Thursday, 4 July 2013

how to implement logic with for loop


Authour:I will teach you courses online
C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:9703619391 E-mail: vas.shrinivas002@gmail.com
We want like this

1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1


Story:

Few days back in our house we have celebrated our brother birthday.
My uncle instructed their are 5 steps are their, Arrange 5 chairs in each step.

He Expected 20 people today.

We arranged neatly came out, See below how we arranged.



Details explanation:

Step one-1 1 1 1 1--------five chairs
Step two-1 1 1 1 1--------five chairs
Step three-1 1 1 1 1--------five chairs
Step four-1 1 1 1 1--------five chairs
Step five-1 1 1 1 1-------five chairs

HEAR IS CODE
START COPY FROM BELOW IN NOTEPAD AND RUN IT BEFORE RUN SAVE AS HTM FILE

<html>
<body>
<script type="text/javascript">
var steps,chairs;


for(steps=1;steps<=5;steps++)
{

             for(chairs=1;chairs<=5;chairs++)

                          {

              document.write(" 1 ");

                              }
                       
                   document.write("<BR>");
}
</script>
</body>
<html>
------------------------- COPY END HEAR ----------------------------------
Continue with next post
http://javascriptwithshrinivas.blogspot.com/2013/07/more-on-logic-using-for-loop.html

Today try this How to write letter b in javascript



Authour:-I will teach you courses online

C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:919703619391 E-mail: vas.shrinivas002@gmail.com
Today also small test for users, Write Letter B in javascript.

You tried alot then try this. I have allready written in C language.


http://corcppwithshrinivas.blogspot.com/2013/04/how-to-write-letter-b-with-c.html

Wednesday, 3 July 2013

Today try this How to write letter v in javascript

Authour:I will teach you courses online

C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:919703619391 E-mail: vas.shrinivas002@gmail.com


My dear freinds today try this, Write letter V in javascript

If you tried alot not able, No problem i have allready written in c Use this.

http://corcppwithshrinivas.blogspot.in/2013/04/writing-letter-v-with-c-language.html

Tuesday, 2 July 2013

switch statement


Authour:I will teach you courses online

C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:919703619391 E-mail: vas.shrinivas002@gmail.com
--------------------------------------------------------------------------------------------
Switch works like START button in windows 7, If you click control panel automatically cp[control panel] will open.

Same way switch will work

switch(button)  {
case "next":
window.location="next.html";
break;

case "previous":
window.location="prev.html";
break;

case "home":
window.location="home.html";
break;

default:
window.alert("Wrong button.");

}


contd after lunch..................with deeeeeep explanation.
-----------------------------------------------------------------------------------------

Monday, 1 July 2013

multiple if and else


------------------------------------------------------------------------------------------------------------Like previous today you decided to go your home town, But you stuck in traffic jam.

Authour:I will teach you courses online

C Language C++ Asp.net VB.net Oracle Hardware and Networking MCSE
Contact: Name: Shrinivas Mobileno:9703619391 E-mail: vas.shrinivas002@gmail.com

At that moment you r thinking that IF i reach railway station at 10:00 am i can catch train, else   11:00 am BUS  is their else 12:00 pm private traveler are their.

if (time < 10 )

document.write("I catch the train");

else if (time < 11 )

document.write("I catch the bus");

else if(time < 12)

document.write("I catch the private bus");

Other example



Let us assume that you went for run race. Before starting run race they announced if anybody wins prize is 1 lakh
                               second prize is 50 thousand
                               third prize is 25 thousand

Obviously you want 1 lakh that is 1 prize.

if(score==1)

document.write("Award is 1 laksh rupeees");

else if(score==2)

document.write("Award is 50 thousand rupeees");

else if(score==3)

document.write("Award is 25 thousand");

     


----------------------------------------------------------------------------------------------------------