Tuesday, 16 July 2013

advanced technique on 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
(india)
E-mail: vas.shrinivas002@gmail.com

To day friend ivan. Asked below prog why cannot u try this.
 1
121
1221
12221
122221
Program logic Is hear.



----------------------------start copy from below--------------------------------------------------
<html>
<body>
<script type="text/javascript">
var i,j;
for(i=1;i<=5;i++)
           {
        document.write("1");

                  for(j=1;j<i;j++)
                      {

                      document.write("2");
                            }

               if(i>1)
                  {
             document.write("1");
                     }                         
              document.write("<BR>");
            }

</script>
</body>
</html>
---------------end of copy above---------------


I want like this

1
121
1221
12221
122221
Child observed 1 is common frent and back 1 .....1
that's why we added first 1 at  starting of program and second 1added ending of program like this
document.write("1") 
-------
----
-----
-----
document.write("1");

after completed this. It should come next line that's why i used document.write("<BR>");

about 2:
Number 2 is added from second  row
you cannot see no 2 first row , added from second row that's why i used [j<i;]

Detailed:
1
121---2 came 1 time
1221---2 came 2 times
12221---2 came 3 times
122221---2 came 4 times      all these acheived with this [j<i]
                      document.write("2");

first iteration 2 cannot print becz [j<i]---1<1
second iteration 2 will print only one time becz  [j<i]---1<2 acheived with document.write("2");
next j wil increment becz of 2<2 now exit from j loop sooooooo on.....

observe this:

 for(j=1;j<i;j++)
                    {

                      document.write("2");
                            }

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
------------------------------------------------------------------------------------------------------------

You can utilize my programs in Database also[ORACLE(PLSQL)] ,MSQLSERVER.
Not only in c++,Net



Monday, 8 July 2013

advanced techniques for codeing



Author: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, just now our freind ivan asked me i want like
this


1                                                       1
11                                                      2
1111                                                   4  
11111111                                              8 
1111111111111111                                 16 
11111111111111111111111111111111       32
How to do this 

HURRY 

don't print 1 with document.write

hurry up!!!!!!!!!!!!!!!!!!!!!!!!!!!

After sometime.

Yesterday i got a message one of our freind send  below program
He told me i was unable to correct problem, Resolve it.


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

var i, j, k=1;

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

                  for(j=1; j<=k; k=k*1)
                     {
                 document.write("1");
                      }
                 document.write("<BR>");
            k=k+k;

}




</script>




</body>
</html>




Then i started correcting see changes below.

---------------copy starts from below---------------------------------------------


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

var i, j, k=1;

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

                  for(j=1; j<=k; j=j+1)
                     {
                 document.write("1");
                      }
document.write("-------> "+k);

document.write("<BR>");


            k=k+k;

}




</script>




</body>
</html>


------------------------COPY ENDS ABOVE-----------------------------------------------------------
You can use above technique any were c,c++,java,.NET......
Hear LOGIC is important. You can use this anywere

How to understand above programm.



             Few days back me and my son went to bakery to purchase chocolates.



Their he found rates 



1) 1/- Rs for biscuit

                                   

2) 2/- Rs for chocolate



3) 4/- Rs for Bun



4) 8/- Rs for veg puff



5) 16/-Rs for veg roll



6) 32/-rs for Mango juice



He murmuring i asked what???? He replied double, Dad i am counting price. 


1
1+1(2)
2+2(4)
4+4(8)
8+8(16)
16+16(32)


I said u r correct.

----------------copy start from below---------------------------------------------

<html>
<body>

<script type="text/javascript">

var listofitems,j;

var soncount=1;


for(listofitems=1;listofitems<=6;listofitems++)

    {

           for(j=1;j<=soncount;j++)

                    {


                  document.write("1");

                        }
                    document.write("---------> "+soncount);

                    document.write("<BR>");
              
                    
                 soncount=soncount+soncount;


    }


</script>
</body>
</html>


------------------------------copy end above --------------------------------------
Listofitems =6

soncount
1---------------------------------------Initially he starts from soncount=1
1+1(2)------------------second round-------soncount=soncount+soncount
2+2(4)------------------third round----
soncount=soncount+soncount4+4(8)
8+8(16)-----------------fourth round--soncount=soncount+soncount 8+8(16)
16+16(32)--------------fifth round----soncount=soncount+soncount 16+16





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

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