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





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

No comments:

Post a Comment