<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-919299427379495628</id><updated>2024-11-06T08:34:52.431+05:30</updated><category term="Array"/><category term="Bisection method"/><category term="Newton-raphson-method"/><category term="Secant-method"/><category term="constructor in c++"/><category term="html-css"/><category term="virtual function"/><title type='text'>ITs Easy </title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-6151740901119776916</id><published>2021-08-06T15:30:00.010+05:30</published><updated>2021-08-09T00:02:40.314+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array"/><title type='text'>Array in data structure mcq (Multiple choice questions)</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
      &lt;title&gt;Array in data structure mcq (MULTIPLE CHOICE QUESTONS)&lt;/title&gt;
      &lt;meta content=&quot;IE=edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
      &lt;meta content=&quot;array, data structure, merging , sorting, transversing&quot; name=&quot;keywords&quot;&gt;
         &lt;meta content=&quot;Try to solve these interesting and logic based multiple choice questions on arrays in data structure.&quot; name=&quot;description&quot;&gt;
      
      &lt;link href=&quot;https://itseassyy.blogspot.com/2021/07/array-data-structure-mcq.html&quot; hreflang=&quot;en&quot; rel=&quot;alternate&quot;&gt;

     &lt;meta charset=&quot;UTF-8&quot;&gt;
       &lt;meta content=&quot;width=device-width, initial-scale=1&quot; name=&quot;viewport&quot;&gt;

    
     &lt;style&gt;
button{
  border:1;
  box-shadow:2px 3px grey;
  background-color:white;
  padding:7px 10px;
        }
        button:hover{
         box-shadow:none;
          background-color:lightblue;
     
        }
    &lt;/style&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
    
    &lt;main&gt;
      &lt;p&gt;1.Which operation can be performed on an array.&lt;br /&gt;
      a.Traversing&lt;br /&gt;
        b.Merging&lt;br /&gt;
        c.Sorting&lt;br /&gt;
      d.All of the Above&lt;br /&gt;
    &lt;button id=&quot;btn&quot; onclick=&quot;myFunction1()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo1&quot;&gt;&lt;/p&gt;
      
      &lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-VW5EUbXrrT0M51X28aQJMxyL9M6vH7dQ6o_8tKPyLtp5Rpkj5TenRy6_3oGcD-_OATD5U9XKldWxjCzkPMXg31WvMNvXGnX3K3RLYwcPmfXHUX5ls3VBwiWTCij11VNbUS2Br9FmEtQ/s320/Array+in+Data+structure-min.jpg&quot; alt=&quot;array is a linear data structure and we can performe diiferent operations on the array like sorting, merging, transversing, searching, etc&quot; class=&quot;center&quot;  /&gt;
      
      
      &lt;p&gt;
      2.Merging of two arrays means arranging arrays in some logical order?
        &lt;br /&gt;
        a.True&lt;br /&gt;
        b.False&lt;br /&gt;
      &lt;button id=&quot;btn&quot; onclick=&quot;myFunction2()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo2&quot;&gt;&lt;/p&gt;
    
      
      &lt;p&gt;
        3.Bubble sort method in array is used for __________ .
        &lt;br /&gt;
        a.Merging two arrays&lt;br /&gt;
        b.Sorting array&lt;br /&gt;
        c.Inserting an element in an array&lt;br /&gt;
        9.None of above&lt;br /&gt;
     &lt;button id=&quot;btn&quot; onclick=&quot;myFunction3()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo3&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
        4.Which is not a searching method in array ____________&lt;br /&gt;
        a.Linear search&lt;br /&gt;
        b.Average search&lt;br /&gt;
        c.Binary search&lt;br /&gt;
        d.None of above&lt;br /&gt;
      &lt;button id=&quot;btn&quot; onclick=&quot;myFunction4()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo4&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
      5.The elements of the array must be in any sorted order in __________&lt;br /&gt;
        a.Linear search&lt;br /&gt;
        b.Binary search&lt;br /&gt;
        c.Both a and b&lt;br /&gt;
        d.None of above&lt;br /&gt;
      &lt;button id=&quot;btn&quot; onclick=&quot;myFunction5()&quot;&gt;ANSWER&lt;/button&gt;
      &lt;/p&gt;
&lt;p id=&quot;demo5&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
        6.Another name of bubble sort algorithm is __________ .&lt;br /&gt;
        a.Quick sort &lt;br /&gt;
        b.Exchange sort &lt;br /&gt;
        c.Selection sort&lt;br /&gt;
        d.Insertion sort&lt;br /&gt;
      &lt;button id=&quot;btn&quot; onclick=&quot;myFunction6()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo6&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
        7.Which one is not a sparse matrix __________ .
        &lt;br /&gt;
        a.Diagonal matrix&lt;br /&gt;
        b.Upper traingular matrix&lt;br /&gt;
        c.Lower triangular matrix&lt;br /&gt;
        d.None of above&lt;br /&gt;
     &lt;button id=&quot;btn&quot; onclick=&quot;myFunction7()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo7&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
        8.Method of linearization is a technique in which elements of matrix stored in a one dimensional array.&lt;br /&gt;
        a.True&lt;br /&gt;
        b.False&lt;br /&gt;
      &lt;button id=&quot;btn&quot; onclick=&quot;myFunction8()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo8&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
        9.Memory used by array cannot be increased or decreased at run time or compile time.&lt;br /&gt;
        a.Yes&lt;br /&gt;
        b.No&lt;br /&gt;
      &lt;button id=&quot;btn&quot; onclick=&quot;myFunction9()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo9&quot;&gt;&lt;/p&gt;
      
      &lt;p&gt;
        10.The elements of the array not need to be in sorted order in __________ search.&lt;br /&gt;
        a.Linear&lt;br /&gt;
        b.Binary&lt;br /&gt;
        c.Both a and b&lt;br /&gt;
        d.Tree&lt;br /&gt;
    &lt;button id=&quot;btn&quot; onclick=&quot;myFunction10()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo10&quot;&gt;&lt;/p&gt;
    &lt;/main&gt;
   
    &lt;script&gt;
        var clickControl=true;
  
function myFunction1(){
    if(clickControl){
        document.getElementById(&quot;demo1&quot;).innerHTML=&quot;&lt;b&gt;Answer:d&lt;/b&gt;&lt;br/&gt;1.Traversing means visiting or processing the elements &lt;br/&gt;2.Sorting means arranging the elements in some order like asending or descending &lt;br/&gt;3.Merging is the process of joining two different arrays&lt;br/&gt;All these operations can be performed on the array, Hence the correct answer is option (d)&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo1&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }

}
  function myFunction2(){
  
    if(clickControl){
        document.getElementById(&quot;demo2&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Merging of array refers to combining the elements of two arrays into a sinle array&lt;br/&gt; Sorting is the process in which we arrange arrays in some logical orders like ascending or descending&lt;br/&gt; Hence our answer is (b)False&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo2&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
  }
  
    function myFunction3(){
  
    if(clickControl){
        document.getElementById(&quot;demo3&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br /&gt;Bubble sort method is one of the simplest method for sorting the array into ascending order&lt;br/&gt;Hence, Answer is sorting method&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo3&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
      function myFunction4(){
  
    if(clickControl){
        document.getElementById(&quot;demo4&quot;).innerHTML=&quot;&lt;b&gt;Answer:b&lt;/b&gt;&lt;br/&gt; There are two types of searches in array &lt;br/&gt; 1.Binary search :Binary search is used when we know that the elements of the array is sorted in some logical order like ascending or descending. &lt;br/&gt; 2.Linear search : Linear search is applied when we don&#39;t know that the element of the array is sorted or not.&lt;br/&gt; Hence, Average search is false one which is not exist&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo4&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
      }
  
        function myFunction5(){
  
    if(clickControl){
        document.getElementById(&quot;demo5&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt; There are two types of searches in array &lt;br/&gt; 1.Binary search :Binary search is used when we know that the elements of the array is sorted in some logical order like ascending or descending. &lt;br/&gt; 2.Linear search : Linear search is applied when we don&#39;t know that the element of the array is sorted or not.&lt;br/&gt; Hence, Average search is false one which is not exist&lt;br/&gt; Hence, binary search is correct Answer&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo5&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
        }
          
  function myFunction6(){
  
    if(clickControl){
        document.getElementById(&quot;demo6&quot;).innerHTML=&quot;&lt;b&gt;Answer:b&lt;/b&gt;&lt;br/&gt;Exchange sort is another name of bubble sort because in bubble sorting method exchange between elements take place so as to sort them&lt;br/&gt; Hence, Correct Answer is Exchange sort&quot; ;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo6&quot;).innerHTML=&quot; &quot;;
       clickControl=!clickControl;
    }
  }
  
            function myFunction7(){
  
    if(clickControl){
        document.getElementById(&quot;demo7&quot;).innerHTML=&quot;&lt;b&gt;Answer: d&lt;/b&gt;&lt;br /&gt;What is a sparse matrix&lt;br/&gt;Ans- Sparse matrix is a matrix which contains majority of their elements as zeros&lt;br/&gt; 1.Upper triangular matrix&lt;br/&gt; 2.Lower triangular matrix &lt;br/&gt; 3.Diagonal matrix&lt;br/&gt; All above matrix comes in sparse matrix because all they contains majority of elements as zeros&lt;br/&gt; Hence, Correct answer is (d)None of above&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo7&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
            }
  
              function myFunction8(){
  
    if(clickControl){
        document.getElementById(&quot;demo8&quot;).innerHTML=&quot;&lt;b&gt;Answer:a&lt;/b&gt;&lt;br/&gt;Method of linearization is a technique in which elements of matrix stored in a one dimensional array.&lt;br/&gt; Hence, Correct answer is (a)True &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo8&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
                function myFunction9(){
  
    if(clickControl){
        document.getElementById(&quot;demo9&quot;).innerHTML=&quot;&lt;b&gt;Answer:a&lt;/b&gt;&lt;br /&gt;Memory used by array cannot be increased or decreased because arrays are immutable after once the are created&lt;br/&gt; Hence, Correct answer is(a)Yes &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo9&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
                  function myFunction10(){
  
    if(clickControl){
        document.getElementById(&quot;demo10&quot;).innerHTML=&quot;&lt;b&gt;Answer:a&lt;/b&gt;&lt;br /&gt; There are two types of searches in array &lt;br/&gt; 1.Binary search :Binary search is used when we know that the elements of the array is sorted in some logical order like ascending or descending. &lt;br/&gt; 2.Linear search : Linear search is applied when we don&#39;t know that the element of the array is sorted or not.&lt;br/&gt; Hence, Average search is false one which is not exist&lt;br/&gt; Hence, Correct answer is Linear search(a)&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo10&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
      
    &lt;/script&gt;
        
        &lt;/body&gt;
  
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/6151740901119776916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/07/array-data-structure-mcq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/6151740901119776916'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/6151740901119776916'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/07/array-data-structure-mcq.html' title='Array in data structure mcq (Multiple choice questions)'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-VW5EUbXrrT0M51X28aQJMxyL9M6vH7dQ6o_8tKPyLtp5Rpkj5TenRy6_3oGcD-_OATD5U9XKldWxjCzkPMXg31WvMNvXGnX3K3RLYwcPmfXHUX5ls3VBwiWTCij11VNbUS2Br9FmEtQ/s72-c/Array+in+Data+structure-min.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>India</georss:featurename><georss:point>20.593684 78.96288</georss:point><georss:box>-7.7165498361788458 43.80663 48.903917836178849 114.11913</georss:box></entry><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-6315539158843688655</id><published>2021-05-15T00:06:00.010+05:30</published><updated>2021-07-23T22:57:58.084+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="constructor in c++"/><title type='text'>Constructor in c++</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
      &lt;link href=&quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html&quot; rel=&quot;alternate&quot;&gt;
     &lt;meta content=&quot;IE=edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
     &lt;meta charset=&quot;UTF-8&quot;&gt;
       &lt;meta content=&quot;width=device-width, initial-scale=1&quot; name=&quot;viewport&quot;&gt;

        &lt;style&gt;

            details{
                cursor: pointer;
                padding: 10px;
                background-color:lightskyblue;
                margin-bottom: 10px;

            }
            code{
                font-family: &#39;Courier New&#39;, Courier, monospace;
                background-color:paleturquoise;
                color:darkblue;
            }

            @media screen and (min-width: 1001px)
            {
                .output{
        padding: 5px 0 5px 30px;
    }
            
            code{
                width:700px;
                padding: 20px;
                display: inline-block;
                overflow: auto;
                height: 400px;
            }
        }
        @media screen and (max-width: 600px)
            {
            
            code{
                width:fit-content;
                padding: 5px;
                display: inline-block;
                overflow: auto;
                height: 300px;
            }
        }
        @media screen and (min-width:600px) and (max-width:1000px)
        {
            .output{
        padding: 5px 0 5px 20px;
    }
         
            code{
                margin-left: 20px;
                margin-top: 10px;
                width: 500px;
                padding: 10px;
                display: inline-block;
                overflow: auto;
                height: 300px;
            }
        }
                    &lt;/style&gt;
    
    &lt;script type=&quot;application/ld+json&quot;&gt;{
    &quot;@context&quot;: &quot;https://schema.org&quot;,
    &quot;@graph&quot;: [
        {
            &quot;@type&quot;: &quot;Organization&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/p/home.html#organization&quot;,
            &quot;name&quot;: &quot;ITs Easy&quot;,
            &quot;url&quot;: &quot;https://itseassyy.blogspot.com/p/home.html&quot;,
            &quot;logo&quot;: {
                &quot;@type&quot;: &quot;ImageObject&quot;,
                &quot;url&quot;: &quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1tSjmdGbnZSls2eR6vnspuqt8zQuYKsM6nJx3wekenOxe8FDxKu1bfc1IRaU4LeVxqlAIjNeqwviAgxEk-6oHGCElryXY5U6manmUVihGzjtL6giixmBXrP3m7_NDPF4yqEjgUeE-z8U/w400-h266/ITs+Easy+logo.jpg&quot;
            }
        },
        {
            &quot;@type&quot;: &quot;WebSite&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/p/home.html#website&quot;,
            &quot;url&quot;: &quot;https://itseassyy.blogspot.com/p/home.html&quot;,
            &quot;name&quot;: &quot;ITs Easy&quot;,
            &quot;publisher&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/p/home.html#organization&quot;
            },
            &quot;inLanguage&quot;: &quot;en-US&quot;,
            &quot;potentialAction&quot;: {
                &quot;@type&quot;: &quot;SearchAction&quot;,
                &quot;target&quot;: &quot;https://itseassyy.blogspot.com/p/home.html?s={search_term_string}&quot;,
                &quot;query-input&quot;: &quot;required name=search_term_string&quot;
            }
        },
        {
            &quot;@type&quot;: &quot;ImageObject&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#primaryImage&quot;,
   &quot;url&quot;:&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaIxk5tM7lYqFC8vOSefDjpNFlF08mFeisl9WKkNkH7mqJ0PI7f5WYqGPDJ76xKld9xTGMDDMnaMVii7tHfmfe4qbS2OYifHGxR0_yWsB2dcR6B51lAS43JThpDzBccUGjHEXDi3CLS0Q/s320/Constructor-in-c%252B%252B.jpg?fit=745,483&amp;ssl=1&quot;,
            &quot;width&quot;: 745,
            &quot;height&quot;: 483
        },
        {
            &quot;@type&quot;: &quot;BreadcrumbList&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#breadcrumb&quot;,
            &quot;itemListElement&quot;: [
                {
                    &quot;@type&quot;: &quot;ListItem&quot;,
                    &quot;position&quot;: 1,
                    &quot;item&quot;: {
                        &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/p/home.html&quot;,
                        &quot;name&quot;: &quot;Home&quot;
                    }
                },
                {
                    &quot;@type&quot;: &quot;ListItem&quot;,
                    &quot;position&quot;: 2,
                    &quot;item&quot;: {
                        &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/&quot;,
                        &quot;name&quot;: &quot;Constructor in c++&quot;
                    }
                }
            ]
        },
        {
            &quot;@type&quot;: &quot;WebPage&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#webpage&quot;,
            &quot;url&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html&quot;,
            &quot;name&quot;: &quot;Constructor in c++ | ITs Easy&quot;,
            &quot;datePublished&quot;: &quot;2021-03-18T11:18:27+00:00&quot;,
            &quot;dateModified&quot;: &quot;2021-04-07T15:11:55+00:00&quot;,
            &quot;isPartOf&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/p/home.html#website&quot;
            },
            &quot;primaryImageOfPage&quot;: {
                &quot;@id&quot;: &quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWvlfBoY3OShI_XLz4QMwYE-szwDmzxhzXcFMRO4OZz6uZxgfVsvqszuVlmAjo-aWii7kp26ny3ce1xyQ_zZVfRD8azCO5G5mntiWUauCI1tS2SNVy9b6vJkWzMaRGTv3nCLoY1I9f1RA/s320/Constructor-in-c%252B%252B.jpg&quot;
            },
            &quot;inLanguage&quot;: &quot;en-US&quot;,
            &quot;breadcrumb&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#breadcrumb&quot;
            }
        },
        {
            &quot;@type&quot;: &quot;BlogPosting&quot;,
            &quot;headline&quot;: &quot;Constructor in c++ | ITs Easy&quot;,
            &quot;datePublished&quot;: &quot;2021-03-18T11:18:27+00:00&quot;,
            &quot;dateModified&quot;: &quot;2021-04-07T15:11:55+00:00&quot;,
            &quot;author&quot;: {
                &quot;@type&quot;: &quot;Person&quot;,
                &quot;name&quot;: &quot;ITs Easy&quot;
            },
            &quot;publisher&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/p/home.html#organization&quot;
            },
            &quot;description&quot;: &quot;ITs Easy: helps students to learn and help them to achieve their goals.&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#richSnippet&quot;,
            &quot;isPartOf&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#webpage&quot;
            },
            &quot;image&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#primaryImage&quot;
            },
            &quot;inLanguage&quot;: &quot;en-US&quot;,
            &quot;mainEntityOfPage&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#webpage&quot;
            }
        }
    ]
}&lt;/script&gt;
  
     
 
 &lt;/head&gt;

 &lt;body&gt;




&lt;div class=&quot;main&quot;&gt;
    &lt;div class=&quot;content1&quot;&gt;

 &lt;main&gt;
        
                &lt;h2&gt;Constructor&lt;/h2&gt;
&lt;p&gt;
   
    A &lt;dfn&gt;constructor&lt;/dfn&gt; is a &#39;special&#39; member function whose task is to initialize the objects of its class. It is special because its name is same as the class name. The constructor is invoked whenever an object of its associated class is created. it is calles constructor because it Constructs the value of data members of the class.
    &lt;/p&gt;&lt;br /&gt;
    &lt;h3&gt;Types of constructors&lt;/h3&gt;
    &lt;ol&gt;
        &lt;li&gt;Default constructor&lt;/li&gt;
        &lt;li&gt;Parametrized construtor&lt;/li&gt;
        &lt;li&gt;Copy contructor&lt;/li&gt;
    &lt;/ol&gt;
   
   &lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaIxk5tM7lYqFC8vOSefDjpNFlF08mFeisl9WKkNkH7mqJ0PI7f5WYqGPDJ76xKld9xTGMDDMnaMVii7tHfmfe4qbS2OYifHGxR0_yWsB2dcR6B51lAS43JThpDzBccUGjHEXDi3CLS0Q/s876/Constructor-in-c%252B%252B.jpg&quot; style=&quot;display: block; padding: 1em 0; text-align: center;&quot;&gt;&lt;img alt=&quot;Constructor in c++&quot; border=&quot;0&quot; data-original-height=&quot;489&quot; data-original-width=&quot;876&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaIxk5tM7lYqFC8vOSefDjpNFlF08mFeisl9WKkNkH7mqJ0PI7f5WYqGPDJ76xKld9xTGMDDMnaMVii7tHfmfe4qbS2OYifHGxR0_yWsB2dcR6B51lAS43JThpDzBccUGjHEXDi3CLS0Q/s320/Constructor-in-c%252B%252B.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
    
    &lt;details&gt;
        &lt;summary&gt;Special characteristics of constructor function:&lt;/summary&gt;
        &lt;ol&gt;
            &lt;li&gt;They should be declared in the public section.&lt;/li&gt;
            &lt;li&gt;They are invoked automatically when the objects are created.&lt;/li&gt;
            &lt;li&gt;They do not have return type, not even void and therefore, and they cannot return values.&lt;/li&gt;
            &lt;li&gt;They cannot be inherited, though a derived class can call the base class constructor.&lt;/li&gt;
            &lt;li&gt;Like others c++ function, they can have default arguments.&lt;/li&gt;
            &lt;li&gt;Constructors cannot virtual.(meaning of virtual will be discussed on another page please refer link below)&lt;br /&gt;
         &lt;a href=&quot;https://itseassyy.blogspot.com/2021/04/virtual-function.html&quot;&gt;Virtual function in c++&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;we cannot refer to their addresses&lt;/li&gt;
        &lt;li&gt;An object with a constructor or (distructor) cannot be used as a member of a union.&lt;/li&gt;
        &lt;li&gt;They make &#39;implicit calls&#39; to the operators &lt;strong&gt;new&lt;/strong&gt; and &lt;strong&gt;deleted&lt;/strong&gt; when memory allocation required.&lt;/li&gt;
        &lt;/ol&gt;
        &lt;br /&gt;
        Remember, when a constructor is declared for a class, initialzed of the class objects becomes mandatory.
    &lt;/details&gt;

 
    &lt;code&gt;
        // A construcotr is declared and defined as follows:&lt;br /&gt;
        class integer&lt;br /&gt;
        {&lt;br /&gt;
        int m, n;&lt;br /&gt;
        public:&lt;br /&gt;
        integer(void);   //Constructor declared&lt;br /&gt;
        .......&lt;br /&gt;
        };&lt;br /&gt;
        integer::integer(void)  // constructor deifned&lt;br /&gt;
        {&lt;br /&gt;
            m=0; n=0;&lt;br /&gt;
        }&lt;br /&gt;
    &lt;/code&gt;
  

    &lt;p&gt;
        When a class conatins a costructor like one defined above, it is guranteed that an object created bt the class will be initialized automatically. for example, the declaration&lt;br /&gt;
&lt;br /&gt;
        integer int1;  // object int1 created &lt;br /&gt;&lt;br /&gt;
        not only creates the object int1 of type integer but also initializes its data members m and n to zero. There is no need to write any statement to invoke the constructor function (as we do with the normal member functions). if a &#39;normal&#39; member function is defined for zero initializatin, we would need to invoke the function for each function for each object of the object separately. This would be very inconvenient, it there are a large number of onjects.
    &lt;/p&gt;
   
   &lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
      var aax_size=&#39;300x600&#39;;
      var aax_pubname = &#39;suraj0f0d-21&#39;;
      var aax_src=&#39;302&#39;;
    &lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;http://c.amazon-adsystem.com/aax2/assoc.js&quot;&gt;&lt;/script&gt;
    
    &lt;h3&gt;Parameterized constructor&lt;/h3&gt;
    &lt;p&gt;The constructor integer(), defined above, initialize the data memeber of all the object to zero. However, in practice it may be necessary to initialize the various data element of different object with different values when they are created. C++ permits us to achieve this objective by passing argument to the constructor function when the object are created. The constructor that can take arguments are called parameterized constructor.&lt;/p&gt;
    
    &lt;p&gt;The contructor integer() may be modified to take argument as shown below:&lt;/p&gt;&lt;br /&gt;
        &lt;code&gt;
            class integer&lt;br /&gt;
            {&lt;br /&gt;
                int m, n;&lt;br /&gt;
                public:&lt;br /&gt;
                integer(int x, int y); // parameterized constructor&lt;br /&gt;
                .......&lt;br /&gt;
                .......&lt;br /&gt;
            };

            integer::integer(int x, int y);&lt;br /&gt;
            {&lt;br /&gt;
                m = x; n = y;&lt;br /&gt;

            }&lt;br /&gt;
    
        &lt;/code&gt;

        &lt;br /&gt;
        &lt;p&gt;
        When a constructor has been parameterized, the object declaration statement such as&lt;br /&gt;
        &lt;br /&gt;
        integer int1;&lt;br /&gt;&lt;br /&gt;
        may not work. we much pass the initial values as argument to the constructor function when an object is declared. This can be done in two ways
        &lt;br /&gt;
        &lt;ul&gt;
            &lt;li&gt;By calling the constructor explicitly&lt;/li&gt;
            &lt;li&gt;By calling the constructor implicitly&lt;/li&gt;
        &lt;/ul&gt;
        &lt;br /&gt;
              
        The following declaration illustrates the first method:&lt;br /&gt;&lt;br /&gt;
        integer int1 = integer (0,100); // explicit call&lt;br /&gt;&lt;br /&gt;
        The statement creates an integer object int1 and passes the value 0 and 100 to it. The second is implemented to as follows:&lt;br /&gt;&lt;br /&gt;
        &lt;br /&gt;int1(0,100); //implicit call&lt;br /&gt;&lt;br /&gt;
        This method, someitmes called the shorthand method, is used very often as it is shorter, looks better and is easy to impliment.&lt;br /&gt;
        Remember, when the construtor is parameterized, we must provide appropriate argument fo the constructor.
              

    &lt;h3&gt;Copy constructor&lt;/h3&gt;
    &lt;p&gt;A copy constructor is used to declare and initialize an object from another object for example, the statement&lt;br /&gt;
    &lt;br /&gt;
    integer I2 (I1);
    &lt;br /&gt;&lt;br /&gt;

    would define the object I2 and at the same time initialize it to the value of I1. Another form of this statement is &lt;br /&gt;&lt;br /&gt;
    integer I2 = I1;&lt;br /&gt;&lt;br /&gt;

    The process of initialize through a copy construcor is known as copy initialization. Remember, the statement&lt;br /&gt;&lt;br /&gt;
    I2 = I1;&lt;br /&gt;&lt;br /&gt;
    will not invoke the copy condtrucotr. However if 01 and I2 are objects, this statement is legal and simply assigns the value of I1 and I2, member-by-member. This is the task of the overloaded assignment operator(=). We shall see more about this later.
    &lt;br /&gt;
    &lt;/p&gt;
    &lt;p&gt;
         copy construtor takes a reference to an object of the same class as itself as an argument, Let us consider a simple example of constructing and using a copy constructor as shown in below program.
    &lt;/p&gt;

    &lt;div class=&quot;code&quot;&gt;
    &lt;code&gt;
      #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
        using namespace std;&lt;br /&gt;&lt;br /&gt;
        class code&lt;br /&gt;
        {&lt;br /&gt;
            int id;&lt;br /&gt;
            public:&lt;br /&gt;
            code(){}  // constructor&lt;br /&gt;
            code(int a)  //constructor again&lt;br /&gt;
            {&lt;br /&gt;
                id=a;&lt;br /&gt;
            }&lt;br /&gt;

            code(code &amp;amp; x) //copy constructor&lt;br /&gt;
            {&lt;br /&gt;
                id=x.id;  // copy in the value&lt;br /&gt;
            }&lt;br /&gt;

            void display(void)&lt;br /&gt;
            {&lt;br /&gt;
                cout&amp;lt;&amp;lt;id;&lt;br /&gt;

            }&lt;br /&gt;

        }; &lt;br /&gt;&lt;br /&gt;
        int main()&lt;br /&gt;
        {&lt;br /&gt;
        code A(100); //object A is created and initialzed&lt;br /&gt;
        code B(A);  //copy constructor called&lt;br /&gt;
        code C = A; //copy constructor called again&lt;br /&gt;
        code D;  // D is created, not initilized&lt;br /&gt;
        D = A;  // copy construtor not called&lt;br /&gt;&lt;br /&gt;
        cout&amp;lt;&amp;lt;&quot;\n id of A: &quot;; A.display();&lt;br /&gt;
        cout&amp;lt;&amp;lt;&quot;\n id of B: &quot;; B.display();&lt;br /&gt;
        cout&amp;lt;&amp;lt;&quot;\n id of C: &quot;; C.display();&lt;br /&gt;
        cout&amp;lt;&amp;lt;&quot;\n id of D: &quot;; D.display();&lt;br /&gt;
        return 0;&lt;br /&gt;
        }&lt;br /&gt;
    &lt;/code&gt;

    &lt;div class=&quot;output&quot;&gt;
    &lt;samp&gt;&lt;strong style=&quot;font-size: 15px;&quot;&gt;Output:&lt;/strong&gt;
      id of A : 100&lt;br /&gt;
    id of B : 100&lt;br /&gt;
id of C : 100&lt;br /&gt;
id of D : 100&lt;/samp&gt;

&lt;/div&gt;


&lt;div class=&quot;note&quot;&gt;
    &lt;h3&gt;Note:&lt;/h3&gt;
  &lt;p&gt;A reference variable has been used as an argument to th copy constructor, We cannot pass the argument by value to a copy constructor.
&lt;/p&gt;
&lt;/div&gt;
   &lt;/div&gt;

      &lt;/main&gt;
              &lt;/div&gt;
              
   &lt;/div&gt;





 &lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/6315539158843688655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/05/constructor-in-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/6315539158843688655'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/6315539158843688655'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/05/constructor-in-c.html' title='Constructor in c++'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaIxk5tM7lYqFC8vOSefDjpNFlF08mFeisl9WKkNkH7mqJ0PI7f5WYqGPDJ76xKld9xTGMDDMnaMVii7tHfmfe4qbS2OYifHGxR0_yWsB2dcR6B51lAS43JThpDzBccUGjHEXDi3CLS0Q/s72-c/Constructor-in-c%252B%252B.jpg" height="72" width="72"/><thr:total>1</thr:total><georss:featurename>United States</georss:featurename><georss:point>37.09024 -95.712891</georss:point><georss:box>7.2089795705211266 -130.86914368220903 66.97150042947888 -60.556638317790984</georss:box></entry><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-8372569021675813120</id><published>2021-04-30T02:24:00.055+05:30</published><updated>2021-08-10T21:11:21.271+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="virtual function"/><title type='text'>What is virtual function in c++</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
     
    &lt;meta name=&quot;keywords&quot; content=&quot;virtual function, polymorphism, base, derived, runtime polymorphism&quot;&gt;
     &lt;meta content=&quot;IE=edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
     &lt;meta charset=&quot;UTF-8&quot;&gt;
       &lt;meta content=&quot;width=device-width, initial-scale=1&quot; name=&quot;viewport&quot;&gt;
&lt;link href=&quot;https://itseassyy.blogspot.com/2021/04/virtual-function.html&quot; lang=&quot;en-US&quot; alternate=&quot;https://itseassyy.com/&quot;&gt;
       &lt;style&gt;
        

            details{
                padding: 10px;
                background-color:honeydew;
                margin-bottom: 10px;

            }
            code{
                font-family: &#39;Courier New&#39;, Courier, monospace;
                background-color:rgb(153, 184, 241);
                color:darkblue;
            }

            @media screen and (min-width: 1001px)
            {
               .center{
          width:70%;
              padding-left:50px;
              }
                .output{
        padding: 5px 0 5px 30px;
    }
            
            code{
                margin-left: 30px;
                margin-top: 20px;
                width:700px;
                padding: 20px;
                display: inline-block;
                overflow: auto;
                height: 400px;
            }
        }
        @media screen and (max-width: 600px)
            {
            
            code{
                width:fit-content;
                padding: 5px;
                display: inline-block;
                overflow: auto;
                height: 400px;
            }
        }
        @media screen and (min-width:600px) and (max-width:1000px)
        {
            .output{
        padding: 5px 0 5px 20px;
    }
         
            code{
                margin-left: 20px;
                margin-top: 10px;
                width: 500px;
                padding: 10px;
                display: inline-block;
                overflow: auto;
                height: 400px;
            }
        }
                    &lt;/style&gt;
     
 
 &lt;/head&gt;

 &lt;body&gt;
     


&lt;div class=&quot;main&quot;&gt;
    &lt;div class=&quot;content1&quot;&gt;

            &lt;section&gt;
&lt;p&gt;
    Polymorphism refers to the property by which objects belonging to different classes are able to respond to the same message, but in different forms. An essential requirement of polymorphism is therfore the ability to refer to object without any regards to their classes.
    This necessities the use of a single pointer variable to refer to the objects of different classes.&lt;br/&gt;&lt;br/&gt;
     Here, we use pointers to base class to refer to all the derived objects.
    But, we just discovered that a base pointer, even when it is made to contain the address of a derived class, always executes the function in a base class. The compiler simply ignores the content of the pointer and chooses the member function that matches the type of pointer. How do we then achieve polymorphism? it is achieved using what is known as &lt;dfn&gt;Virtual function.&lt;/dfn&gt;
    &lt;/p&gt;
    
    &lt;details&gt;
        &lt;summary&gt;Virtual function details&lt;/summary&gt;
        &lt;p&gt;
            When we use the same function name in both the base and derived classes, the function in base class is declared as virtual using keyword &lt;strong&gt;virtual&lt;/strong&gt; preceding its normal declaration . When a function is made virtual, C++ determines which function to use at run time based on the type of object pointed by the base pointer, rather than the type of the pointer. Thus, by making the base pointer to point to different objects, we can execute different versions of the virtual function.
        &lt;/p&gt;
    &lt;/details&gt;

    &lt;div class=&quot;code&quot;&gt;
    &lt;code&gt;
        // Virtual-funtion&lt;br/&gt;&lt;br/&gt;
        #include &amp;lt;iostream&amp;gt;
        &lt;br/&gt;
        using namespace std;
        &lt;br/&gt;
        &lt;br/&gt;
        class Base{
            &lt;br/&gt;
            public:&lt;br/&gt;
            void display(){&lt;br/&gt;
                cout&amp;lt;&amp;lt; &quot;\n DISPLAY base&quot;;
                &lt;br/&gt;
            }
                virtual void show(){
                    &lt;br/&gt;
                    cout &amp;lt;&amp;lt; &quot;\n show base&quot;;
                    &lt;br/&gt;
                }&lt;br/&gt;
            };
            &lt;br/&gt;&lt;br/&gt;
            class Derived : public Base{&lt;br/&gt;
                public:&lt;br/&gt;
                void display()&lt;br/&gt;
                {
                    &lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;\n DIPSLAY derived&quot;;
                    &lt;br/&gt;
                }&lt;br/&gt;
                void show(){
                    &lt;br/&gt;
                    cout &amp;lt;&amp;lt; &quot;\n show derived&quot;;
                    &lt;br/&gt;
                }&lt;br/&gt;
            };
            &lt;br/&gt;&lt;br/&gt;
            int main()&lt;br/&gt;
            {&lt;br/&gt;
                Base B;&lt;br/&gt;
                Derived D;&lt;br/&gt;
                Base *bptr;&lt;br/&gt;
                cout &amp;lt;&amp;lt; &quot;\n bptr points to base \n&quot;;
                &lt;br/&gt;
                bptr = &amp;amp;B;&lt;br/&gt;
                bptr-&gt; display(); //calls base version&lt;br/&gt;
                bptr-&gt; show();  //calls abse version&lt;br/&gt;
                &lt;br/&gt;
                cout &amp;lt;&amp;lt; &quot;\n bptr points to derived \n&quot;;
                bptr= &amp;amp;D;&lt;br/&gt;
                bptr-&gt; display(); // calls derived version&lt;br/&gt;
                bptr-&gt; show(); //calls derived version&lt;br/&gt;
                return 0;
                &lt;br/&gt;
            }
    &lt;/code&gt;
    &lt;div class=&quot;output&quot;&gt;
    &lt;samp&gt;&lt;strong style=&quot;font-size: 15px;&quot;&gt;Output:&lt;/strong&gt;
        &lt;br/&gt;bptr points to base&lt;br/&gt;
    Display base&lt;br/&gt;
Show base&lt;br/&gt;
bptr points to Derived &lt;br/&gt;
Display base&lt;br/&gt;
Show derived&lt;/samp&gt;
&lt;/div&gt;
              &lt;/div&gt;&lt;br/&gt;


&lt;div class=&quot;note&quot;&gt;
    &lt;h3&gt;Note:&lt;/h3&gt;
    &lt;p&gt;When bptr is made to point to the object D, the statement 
        &lt;br/&gt;
        bptr-&gt; display();&lt;br/&gt; calls only the function associated with the &lt;strong&gt;Base&lt;/strong&gt;(i.e, Base::display()),
        Whereas the statement&lt;br/&gt;
        bptr-&gt;show();&lt;br/&gt;
        calls the derived version to show(). This is because the funtion display() has not been made virtual in the &lt;strong&gt;Base&lt;/strong&gt; class.&lt;br/&gt;
    &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
    One of the important point to remember is that, we must access virtual function through the use of a pointer declared as a pointer to the abse class.
    Why can&#39;t we use object name (with the dot operator) the same way as any other member function  to cal the virtual function?
    We can&#39;t, but remember, run time polymorphsim is achieved only when a virtual fucntion is accessed through a pointer to the base class.
&lt;/p&gt;
&lt;/section&gt;
      &lt;br/&gt;
      
        &lt;img class=&quot;center&quot; src=&quot;https://cdn.educba.com/academy/wp-content/uploads/2020/02/virtual-function-in-c.jpg&quot; alt=&quot;virtual function and runtime polymorphism related image in c++&quot;&gt;&lt;br/&gt;


&lt;section&gt;
    &lt;h2&gt;Runtime Polymorphism&lt;/h2&gt;
    &lt;div class=&quot;code&quot;&gt;
        &lt;code&gt;
            //Runtime-polymorsphism&lt;br/&gt;&lt;br/&gt;
            #include &amp;lt;iostream&amp;gt;
            &lt;br/&gt;
            using namespace std;
            &lt;br/&gt;
            &lt;br/&gt;
            class media{
                &lt;br/&gt;
                protected:&lt;br/&gt;
                char title[50];&lt;br/&gt;
                float price;&lt;br/&gt;

                public:&lt;br/&gt;
                media(char *s, float a){&lt;br/&gt;
                 srtcpy(title, s);&lt;br/&gt;
                 price = a;&lt;br/&gt;
                    &lt;br/&gt;
                }&lt;br/&gt;
                    virtual void display(){  }&lt;br/&gt; // empty virtual function
                };

                &lt;br/&gt;&lt;br/&gt;
                class book: public media{&lt;br/&gt;
                    int pages;&lt;br/&gt;

                    public:&lt;br/&gt;
                    book(char *s, float a, int p) : media(s,a)&lt;br/&gt;
                    {
                        &lt;br/&gt;
                    pages = p;
                        &lt;br/&gt;
                    }&lt;br/&gt;
                    void display(){  }&lt;br/&gt;
                };
                &lt;br/&gt;&lt;br/&gt;
                class tape: public media{&lt;br/&gt;
                float time;
                &lt;br/&gt;
                public:
                &lt;br/&gt;
                tape(char *s, float a, float t) : media(s,a)&lt;br/&gt;
                {&lt;br/&gt;
                    time=t;
                    &lt;br/&gt;
                }
                &lt;br/&gt;
                void display(){  };&lt;br/&gt;

                };

                void book:: display()&lt;br/&gt;
                {&lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;\n Title:&quot;&amp;gt;&amp;gt;title;
                    cout &amp;lt;&amp;lt;&quot;\n Pages:&quot;&amp;gt;&amp;gt;pages;
                    cout &amp;lt;&amp;lt;&quot;\n Price:&quot;&amp;gt;&amp;gt;price;
&lt;br/&gt;
                }&lt;br/&gt;

                void tape:: display()&lt;br/&gt;
                {&lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;\n Title:&quot;&amp;gt;&amp;gt;title;
                    cout &amp;lt;&amp;lt;&quot;\n Play Time:&quot;&amp;gt;&amp;gt;time&amp;gt;&amp;gt;mins;
                    cout &amp;lt;&amp;lt;&quot;\n Price:&quot;&amp;gt;&amp;gt;price;
&lt;br/&gt;
                }&lt;br/&gt;
                &lt;br/&gt;

                int main()&lt;br/&gt;
                {&lt;br/&gt;
                   
                    char *title = new char[30];&lt;br/&gt;
                    float price, time;&lt;br/&gt;
                    int pages;&lt;br/&gt;
                    //Book details&lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;\n ENTER BOOK DETAILS\n&quot;;&lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;Title:&quot;; cin&amp;gt;&amp;gt; title;&lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;Price:&quot;; cin&amp;gt;&amp;gt; price;&lt;br/&gt;
                    cout &amp;lt;&amp;lt;&quot;pages:&quot;; cin&amp;gt;&amp;gt; pages;&lt;br/&gt;
                    &lt;br/&gt;
                    book book1(title, price, pages)
                    &lt;br/&gt;
                    // Tape details
                    &lt;br/&gt;
                    cout&amp;lt;&amp;lt;&quot;\n ENTER TAPE DETAILS\n&quot;;
                    &lt;br/&gt;
                    cout&amp;lt;&amp;lt;&quot;Title:&quot;;cin&amp;gt;&amp;gt; title;
                    &lt;br/&gt;
                    coyt&amp;lt;&amp;lt;&quot;Price:&quot;; cin&amp;gt;&amp;gt; price;
                    &lt;br/&gt;
                    cout&amp;lt;&amp;lt;&quot;PLay time (mins):&quot;; cin&amp;gt;&amp;gt; time;
                    &lt;br/&gt;
                    tape taprl(title, price, time);
                    &lt;br/&gt;&lt;br/&gt;
                    media* list[2];&lt;br/&gt;
                    list[0]= &amp;amp;book1;&lt;br/&gt;
                    list[1]=&amp;amp;tape1;&lt;br/&gt;
                    cout&amp;lt;&amp;lt; &quot;\n MEDIA DETAILS&quot;;&lt;br&gt;
                    &lt;br/&gt;
                    cout&amp;lt;&amp;lt;&quot;\n ......BOOK........&quot;;
                    &lt;br/&gt;
                    list[0] -&gt; display();  //display book details
                    &lt;br/&gt;
                    cout&amp;lt;&amp;lt;&quot;\n..... TAPE.....&quot;;&lt;br/&gt;
                    list[1] -&gt; display(); //display tape details&lt;br/&gt;       
                    return 0;
                    &lt;br/&gt;
                }
        &lt;/code&gt;
        &lt;div class=&quot;output&quot;&gt;
            &lt;samp&gt;&lt;strong style=&quot;font-size: 15px;&quot;&gt;Output:&lt;/strong&gt;&lt;br/&gt;
            ENTER BOOK DETAILS&lt;br/&gt;
            Title:Programming_in_ANSI_C&lt;br/&gt;
            Price: 88&lt;br/&gt;
            Pages: 400&lt;br/&gt;&lt;br/&gt;
            ENTER TAPE DETAILS
            &lt;br/&gt;
            Title: Computing_concepts&lt;br/&gt;
            Price:90&lt;br/&gt;
            Play time (mins):55&lt;br/&gt;
            &lt;br/&gt;
            MEDIA DETAILS&lt;br/&gt;
            .......BOOK......&lt;br/&gt;
            Title:Programming_in_ANSI_C&lt;br/&gt;
            Pages: 400&lt;br/&gt;
            Price: 88&lt;br/&gt;&lt;br/&gt;
            ......TAPE......
            Title: Computing_concepts&lt;br/&gt;
            Play time: 55mins&lt;br/&gt;
            Price:90
            &lt;/samp&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/section&gt;

&lt;section&gt;
    &lt;h3&gt;Rules for virtual functions&lt;/h3&gt;
    &lt;p&gt;When virtual functions are created implementing late binding, we should observe some basic rules that stisfy the compiler requirements:&lt;/p&gt;
    &lt;ol&gt;
        &lt;li&gt;The virtual functions must be member of some class.&lt;/li&gt;
        &lt;li&gt;They cannot be static members.&lt;/li&gt;
        &lt;li&gt;They are accessed by using object pointers.&lt;/li&gt;
        &lt;li&gt;A virtual function can be friend of another class.&lt;/li&gt;
        &lt;li&gt;A vitual fucntion in a base class must be defined, even though it may not be used&lt;/li&gt;
        &lt;li&gt;The prototypes of the base class version of a virtual function and all derived class versions must be identical. if two functions with the same name have different prototypes, C++ considered them as overloaded function, and the virtual function mechanism is ignored.&lt;/li&gt;
        &lt;li&gt;We cannot have virtual constuctors, but we can have virtual destructors.&lt;/li&gt;
        &lt;li&gt;While a base pointers can point to any type of the derived object, the reverse is not true. That is to say, we cannot use a pointer to a derived class to access an object of the base type.&lt;/li&gt;
        &lt;li&gt;When a base pointer point to a derived class, incrementing or decrementing it will not make it to pont to the next object of the derived class. it is incemented to all decremented only relative to its base type. Therefore, we should not use this method to move the pointer to the next object.&lt;/li&gt;
        &lt;li&gt;If a virtual function is deifned in the base class, it need not be necessarily redefined in the derived class. In suh cases, call will invoke the base function.&lt;/li&gt;
    &lt;/ol&gt;
&lt;/section&gt;
              &lt;/div&gt;           
              
          
&lt;/div&gt;
 




 &lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/8372569021675813120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/04/virtual-function.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/8372569021675813120'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/8372569021675813120'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/04/virtual-function.html' title='What is virtual function in c++'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total><georss:featurename>India</georss:featurename><georss:point>20.593684 78.96288</georss:point><georss:box>-10.835813217639252 43.806627317790984 52.023181217639248 114.11913268220901</georss:box></entry><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-538027939296395654</id><published>2021-04-28T02:04:00.022+05:30</published><updated>2021-08-06T14:58:17.988+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Secant-method"/><title type='text'>Secant method multiple choice questions with answers</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
      &lt;title&gt;Secant method multiple choice questions with answers&lt;/title&gt;
      &lt;meta name=&quot;description&quot; content=&quot;Secant method is a recursive method for finding the root for the polynomials by successive approximation.Secant method is faster than bisection&quot;/&gt;
      &lt;link rel=&quot;alternate&quot; href=&quot;https://itseassyy.blogspot.com/2021/04/secant-method-mcq.html&quot;/&gt;
 
     &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;/&gt;
     &lt;meta charset=&quot;UTF-8&quot; /&gt;
       &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;/&gt;

    &lt;style&gt;
button{
  border:1;
  box-shadow:2px 3px grey;
  background-color:white;
  padding:7px 10px;
        }
        button:hover{
         box-shadow:none;
          background-color:lightblue;
     
        }
      &lt;/style&gt;
    
 
 &lt;/head&gt;

 &lt;body&gt;


  

&lt;div class=&quot;main&quot;&gt;
    &lt;div class=&quot;content1&quot;&gt;
      &lt;h2&gt;What is secant method?&lt;/h2&gt;
&lt;p&gt;Secant method in numerical analysis used to find the roots of the polynomials
    &lt;br/&gt;
    • Secant method is a recursive method for finding the root for the polynomials by successive approximation.&lt;br/&gt;
• It’s similar to the Regula-falsi method but here we don’t need to check f(x1)f(x2)&amp;lt;0 again.&lt;br/&gt;
• It is also calles as 2 point method.&lt;br/&gt;
• Secant method is faster than bisection method and newton raphson method.&lt;br/&gt;
• Newton&#39;s method will fail in cases where the derivative is zero.&lt;br/&gt;
&lt;/p&gt;
       &lt;br/&gt;
       &lt;img class=&quot;center&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYNYMRSdwX8iozmAAbC0HJDAL1n6bhmuBBltOYrQpMjUYBeIl8n7oBJwmDKV9VEOYH-d5MdQ312wkcisAo4WvLr6E-qNK3oBGRbiTuTFokcI3tX-OTAaSYZ9T4ALvP29OeI3NJ9Pl5xMc/w320-h181/images-compressed+%25281%2529.jpg&quot; alt=&quot;web programming&quot;/&gt;



        &lt;h2&gt;Multiple choice questions&lt;/h2&gt;
&lt;p&gt;
1.What is the region of convergence of Secant Method?&lt;br/&gt;
a) 1.5&lt;br/&gt;
b) 1.26&lt;br/&gt;
c) 1.62&lt;br/&gt;
d) 1.66&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction1()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo1&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;2.Secant method converges faster than Bisection method.&lt;br/&gt;
a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction2()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo2&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;3.Secant Method is slower than Newton Raphson Method.&lt;br/&gt;
a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction3()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo3&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;4.The number of iterations in Secant Method are less as compared to Newton Raphson.&lt;br/&gt;
a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction4()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo4&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;5.Secant method is a bracketing method.&lt;br/&gt;
a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction5()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo5&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;6.A quadratic equation x²-4x+4=0 is defined with an initial guess of 10 and 20. Find the approximated value of x2 using Secant Method.&lt;br/&gt;
a) 7.538&lt;br/&gt;
b) 7.853&lt;br/&gt;
c) 7.358.&lt;br/&gt;
d) 7.835&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction6()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo6&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;7.A quadratic e
    quation x²-4x+4=0 is defined with an initial guess of 3 and 2.5. Find the approximated value of root using Secant Method.&lt;br/&gt;
    a) 1.33&lt;br/&gt;
    b) 2.33&lt;br/&gt;
    c) 3.33&lt;br/&gt;
    d) 4.33&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction7()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo7&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;8.A quadratic equation x⁴-x-8=0 is defined with an initial guess of 1 and 2. Find the approximated value of x2 using Secant Method.&lt;br/&gt;
    a) 7.538&lt;br/&gt;
    b) 7.853&lt;br/&gt;
    c) 7.358&lt;br/&gt;
    d) 1.571&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction8()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo8&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;9.A quadratic equation x²-4x+4=0 is defined with an initial guess of 2 and 2.5. Find the approximated value of root using Secant Method.&lt;br/&gt;
a)1&lt;br/&gt;
b)2&lt;br/&gt;
c)3&lt;br/&gt;
d)4&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction9()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo9&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

    &lt;/div&gt;
          
&lt;/div&gt;






    &lt;script&gt;
 
        var clickControl=true;
  
function myFunction1(){
    if(clickControl){
   
        document.getElementById(&quot;demo1&quot;).innerHTML=&quot;&lt;b&gt;Answer: c&lt;/b&gt; &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo1&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }

}
  function myFunction2(){
  
    if(clickControl){
        document.getElementById(&quot;demo2&quot;).innerHTML=&quot;&lt;b&gt;Answer: a&lt;/b&gt; &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo2&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
  }
  
    function myFunction3(){
  
    if(clickControl){
        document.getElementById(&quot;demo3&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt; &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo3&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
      function myFunction4(){
  
    if(clickControl){
        document.getElementById(&quot;demo4&quot;).innerHTML=&quot;&lt;b&gt;Answer: a&lt;/b&gt;  &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo4&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
      }
  
        function myFunction5(){
  
    if(clickControl){
        document.getElementById(&quot;demo5&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt; &lt;br/&gt; &lt;b&gt;Explaination:&lt;/b&gt; secant method is an open method &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo5&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
        }
          
  function myFunction6(){
  
    if(clickControl){
        document.getElementById(&quot;demo6&quot;).innerHTML=&quot;&lt;b&gt;Answer: a&lt;/b&gt;&lt;br/&gt;Explanation: By Secant Method the iterative formula is given as:&lt;br/&gt;x(n+1)=x(n−1)f[x(n)]−x(n)f[x(n−1)] / [f[x(n)]−f[x(n−1)]]&lt;br/&gt;For n=1&lt;br/&gt;x(2)=x(0)f[x(1)]−x(1)f[x(0)] / [f[x(1)]−f[x(0)]]&lt;br/&gt;x(0)=10 and x(1)=20, f(x0)=0 and f(x1)=0.25&lt;br/&gt;Hence x2 = 7.538.&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo6&quot;).innerHTML=&quot; &quot;;
       clickControl=!clickControl;
    }
  }
  
            function myFunction7(){
  
    if(clickControl){
        document.getElementById(&quot;demo7&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Explanation: By Secant Method the iterative formula is given as:&lt;br/&gt;x(n+1)=x(n−1)f[x(n)]−x(n)f[x(n−1)][f[x(n)]−f[x(n−1)]]&lt;br/&gt;For n=1&lt;br/&gt;x(2)=x(0)f[x(1)]−x(1)f[x(0)][f[x(1)]−f[x(0)]]&lt;br/&gt;x(0)=3 and x(1)=2.5, f(x0)=1 and f(x1)=0.25&lt;br/&gt;Hence x2=2.33. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo7&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
            }
  
              function myFunction8(){
  
    if(clickControl){
        document.getElementById(&quot;demo8&quot;).innerHTML=&quot;&lt;b&gt;Answer: d&lt;/b&gt;&lt;br/&gt;Explanation: By Secant Method the iterative formula is given as:&lt;br/&gt;x(n+1)=x(n−1)f[x(n)]−x(n)f[x(n−1)][f[x(n)]−f[x(n−1)]]&lt;br/&gt;For n=1&lt;br/&gt;x(2)=x(0)f[x(1)]−x(1)f[x(0)] / [f[x(1)]−f[x(0)]]&lt;br/&gt;x(0)=1 and x(1)=2, f(x0)=-8 and f(x1)=6&lt;br/&gt;Hence x2= 1.571. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo8&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
                function myFunction9(){
  
    if(clickControl){
        document.getElementById(&quot;demo9&quot;).innerHTML=&quot;&lt;b&gt;Answer: b &lt;/b&gt;&lt;br/&gt;Explanation: By Secant Method the iterative formula is given as:&lt;br/&gt;x(n+1)=x(n−1)f[x(n)]−x(n)f[x(n−1)] / [f[x(n)]−f[x(n−1)]]&lt;br/&gt;For n=1&lt;br/&gt;x(2)=x(0)f[x(1)]−x(1)f[x(0)] / [f[x(1)]−f[x(0)]]&lt;br/&gt;x(0)=2 and x(1)=2.5, f(x0)=0 and f(x1)=0.25&lt;br/&gt;Hence x2=2. Hence for x2=2 f(x) converges to exact root. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo9&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
  
  
  
&lt;/script&gt;
    

 &lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/538027939296395654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/04/secant-method-mcq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/538027939296395654'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/538027939296395654'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/04/secant-method-mcq.html' title='Secant method multiple choice questions with answers'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYNYMRSdwX8iozmAAbC0HJDAL1n6bhmuBBltOYrQpMjUYBeIl8n7oBJwmDKV9VEOYH-d5MdQ312wkcisAo4WvLr6E-qNK3oBGRbiTuTFokcI3tX-OTAaSYZ9T4ALvP29OeI3NJ9Pl5xMc/s72-w320-h181-c/images-compressed+%25281%2529.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Asia</georss:featurename><georss:point>34.047863 100.6196553</georss:point><georss:box>5.7376291638211541 65.4634053 62.358096836178845 135.7759053</georss:box></entry><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-2951063437356625874</id><published>2021-04-28T01:52:00.025+05:30</published><updated>2021-08-12T10:31:32.164+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Newton-raphson-method"/><title type='text'>Newton raphson method multiple choice questions with solutions</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
      &lt;title&gt;Newton raphson method multiple choice questions with solutions&lt;/title&gt;
      &lt;meta content=&quot;Newton, raphson, root, method, numerical, analysis&quot; name=&quot;keywords&quot;&gt;
    &lt;link rel=&quot;alternate&quot; href=&quot;https://itseassyy.blogspot.com/2021/04/newton-raphson.html&quot;/&gt;
      &lt;meta content=&quot;IE=edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
      &lt;meta name=&quot;description&quot; content=&quot;Newton raphson method is one of the fastest convergence method and it is also known as newton&#39;s method. Newton raphson method converges faster than biscetion method&quot;/&gt;

     &lt;meta charset=&quot;UTF-8&quot; /&gt;
       &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;/&gt;


      &lt;style&gt;
button{
  border:1;
  box-shadow:2px 3px grey;
  background-color:white;
  padding:7px 10px;
        }
        button:hover{
         box-shadow:none;
          background-color:lightblue;
     
        }
      &lt;/style&gt;

&lt;script type=&quot;application/ld+json&quot;&gt;
    {
      &quot;@context&quot;: &quot;https://schema.org/&quot;,
      &quot;@type&quot;: &quot;Quiz&quot;,
      &quot;typicalAgeRange&quot;: &quot;7-12&quot;,
      &quot;educationalLevel&quot;: &quot;intermediate&quot;,
      &quot;assesses&quot;: &quot;Numerical methods and statistics&quot;,
      &quot;educationalAlignment&quot;: [
        {
          &quot;@type&quot;: &quot;AlignmentObject&quot;,
          &quot;alignmentType&quot;: &quot;educationalSubject&quot;,
          &quot;targetName&quot;: &quot;Mathematics&quot;
        },
        {
          &quot;@type&quot;: &quot;AlignmentObject&quot;,
          &quot;alignmentType&quot;: &quot;educationalSubject&quot;,
          &quot;targetName&quot;: &quot;Newton raphson method in Numerical methods&quot;
        }
      ],
      &quot;name&quot;: &quot;Quiz about numerical analysis and statistics&quot;,
      &quot;about&quot;: {
        &quot;@type&quot;: &quot;Thing&quot;,
        &quot;name&quot;: &quot;newton raphson method &quot;
      },
      &quot;hasPart&quot;: [
        {
          &quot;@type&quot;: &quot;Question&quot;,
          &quot;eduQuestionType&quot;: &quot;Multiple choice&quot;,
          &quot;learningResourceType&quot;: &quot;Practice problem&quot;,
          &quot;name&quot;: &quot;Question on newton method in numerical analysis&quot;,
          &quot;text&quot;: &quot;1. Rate of convergence of the &lt;b&gt;Newton-Raphson method&lt;/b&gt; is generally__________&quot;,
          &quot;comment&quot;: {
            &quot;@type&quot;: &quot;Comment&quot;,
            &quot;text&quot;: &quot;Q&quot;
          },
          &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
          &quot;suggestedAnswer&quot;: [
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 0,
              &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
              &quot;text&quot;: &quot;a) cubic&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;No, it is incorrect!&quot;
              }
            },
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 1,
              &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
              &quot;text&quot;: &quot;b) Quadratic&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;No, it is incorrect!&quot;
              }
            },
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 2,
              &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
              &quot;text&quot;: &quot;c) Super-linear&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;No, it is incorrect!&quot;
              }
            }
          ],
          &quot;acceptedAnswer&quot;: {
            &quot;@type&quot;: &quot;Answer&quot;,
            &quot;position&quot;: 3,
            &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
            &quot;text&quot;: &quot;d) linear&quot;,
            &quot;comment&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Great job&quot;
            },
            &quot;answerExplanation&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Rate of convergence of the Newton-Raphson method is generally Linear. It states that the value of root through the Newton Raphson method converges slowly&quot;
            }
          }
        },
        {
          &quot;@type&quot;: &quot;Question&quot;,
          &quot;eduQuestionType&quot;: &quot;Multiple choice&quot;,
          &quot;learningResourceType&quot;: &quot;Practice problem&quot;,
          &quot;name&quot;: &quot;Secant method in numerical methods &quot;,
          &quot;text&quot;: &quot;12. The Newton Raphson method fails if __________&quot;,
          &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
          &quot;comment&quot;: {
            &quot;@type&quot;: &quot;Comment&quot;,
            &quot;text&quot;: &quot;Q&quot;
          },
          &quot;suggestedAnswer&quot;: [
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 0,
              &quot;text&quot;: &quot;a) f(x0)=0&quot;,
              &quot;encodingFormat&quot;: &quot;text/html&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;No, it is incorrect!&quot;
              }
            },
              {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 2,
              &quot;text&quot;: &quot;a) f&#39;&#39;(x0)=0&quot;,
              &quot;encodingFormat&quot;: &quot;text/html&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;No, it is incorrect!&quot;
              }
            },
              {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 3,
              &quot;text&quot;: &quot;f’’’(x0)=0&quot;,
              &quot;encodingFormat&quot;: &quot;text/html&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;No, it is incorrect!&quot;
              }
            }
          ],
          &quot;acceptedAnswer&quot;: {
            &quot;@type&quot;: &quot;Answer&quot;,
            &quot;position&quot;: 1,
            &quot;text&quot;: &quot;f’(x)=0&quot;,
            &quot;encodingFormat&quot;: &quot;text/html&quot;,
            &quot;comment&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Correct Answer!&quot;
            },
            &quot;answerExplanation&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;When f’(x0) becomes zero then the value of f(x0)/f’(x0) becomes ∞. Hence Newton Raphson method fails at f’(x0)=0. &quot;
            }
          }
        }
      ]
    }
    &lt;/script&gt;

 
 &lt;/head&gt;

 &lt;body&gt;



&lt;div class=&quot;main&quot;&gt;
    &lt;div class=&quot;content1&quot;&gt;
      &lt;h2&gt;What is Newton raphson method method?&lt;/h2&gt;
&lt;p&gt;Newton&#39;s raphson method, also known as the Newton&#39;s method, named after Isaac Newton and Joseph Raphson, is a root-finding algorithm which produces successively better approximations to the roots of a real-valued function.&lt;br/&gt;
    Newton raphson method is one of the fastest convergence method. It is faster than bisection method. It is a linear method of convergence.
&lt;/p&gt;
       
       &lt;img class=&quot;center&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBr4dFnZmCSIsm3jXhbt_ntezWTh_PzS8Tn5aGoCcDsin7LG7pEYcqhracrVFa6YX3aX0m4r30QSySl-BVqWV27KxW347AOdim3SHh21Y2VEjU26__YVVHA615K15ppgFB9wf2GnWX5q4/s320/newtons+method-compressed.jpg&quot; alt=&quot;mathematics related cover photo&quot;/&gt;



        &lt;h2&gt;Multiple choice questions&lt;/h2&gt;
&lt;p&gt;
1. Rate of convergence of the Newton-Raphson method is generally __________&lt;br/&gt;
a) Linear&lt;br/&gt;
b) Quadratic&lt;br/&gt;
c) Super-linear&lt;br/&gt;
d) Cubic&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction1()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo1&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;2.Newton-Raphson method is used to find the root of the equation x^2 - 2 = 0.  If iterations are started from - 1, then iterations will be&lt;br/&gt;
    A.converge to -1&lt;br/&gt;
    B.converge to √2&lt;br/&gt;
    C.converge to -√2&lt;br/&gt;
    D.no coverage &lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction2()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo2&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

 
&lt;p&gt;3.The Newton-Raphson method of finding roots of nonlinear equations falls under the category of which of the following methods?&lt;br/&gt;
    a) bracketing&lt;br/&gt;
    b) open&lt;br/&gt;
    c) random&lt;br/&gt;
    d) graphical&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction3()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo3&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;4.Using Newton-Raphson method, find a root correct to three decimal places of the question x^3-3x-5=0 .&lt;br/&gt;
    a.2.275&lt;br/&gt;
    b.2.279&lt;br/&gt;
    c.2.222&lt;br/&gt;
    d.None of these&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction4()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo4&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;5. The Iterative formula for Newton Raphson method is given by __________&lt;br/&gt;
    a) x1 = x0-f(x0)/f’(x0)&lt;br/&gt;
    b) x0 = x1-f(x0)/f‘(x0)&lt;br/&gt;
    c) x0 = x1+f(x0)/f’(x0)&lt;br/&gt;
    d) x1 = x0+f(x0)/f‘(x0)&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction5()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo5&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;6. We wish to solve x^2 - 2 = 0 by Newton Raphson technique. If initial guess is x0 = 1.0, subsequent estimate of x (i.e. x1)  will be&lt;br/&gt;
    A.1.414&lt;br/&gt;
    B.1.5&lt;br/&gt;
    C.2.0&lt;br/&gt;
    D.None of these&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction6()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo6&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;7.In Newton Raphson method if the curve f f(x) is constant then __________&lt;br/&gt;
    a) f’(x)=0&lt;br/&gt;
    b) f(x)=0&lt;br/&gt;
    c) f’&#39;(x)=0&lt;br/&gt;
    d) f’(x)=c&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction7()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo7&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;8.   Double (Repeated) root of 4x^3- 8x^2- 3x + 9 = 0 by Newton-raphson method is&lt;br/&gt;
    A. 1.4&lt;br/&gt;
B. 1.5&lt;br/&gt;
C. 1.6&lt;br/&gt;
D. 1.55&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction8()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo8&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;9. For what values of 0 the initial guess will be equal to the next iterative values?&lt;br/&gt;
    a) 70 degrees&lt;br/&gt;
    b) 90 degrees&lt;br/&gt;
    c) 100 degrees&lt;br/&gt;
    d) 55 degrees&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction9()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo9&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;10.At which point the iterations in the Newton Raphson method are stopped?&lt;br/&gt;
    a) When the consecutive iterative values of x are not equal&lt;br/&gt;
    b) When the consecutive iterative values of x differ by 2 decimal places&lt;br/&gt;
    c) When the consecutive iterative values of x differ by 3 decimal places&lt;br/&gt;
    d) When the consecutive iterative values of x are equal&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction10()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo10&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;11.Using Newton-Raphson method, find a root correct to three decimal places of the equation sin x = 1 - x.&lt;br/&gt;
    A. 0.511&lt;br/&gt;
B. 0.500&lt;br/&gt;
C. 0.555&lt;br/&gt;
D. None of these&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction11()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo11&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;12.The Newton Raphson method fails if __________&lt;br/&gt;
    a) f’(x0)=0&lt;br/&gt;
b) f’’(x0)=0&lt;br/&gt;
c) f(x0)=0&lt;br/&gt;
d) f’’’(x0)=0&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction12()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo12&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;13.In which of the following methods proper choice of initial value is very important?&lt;br/&gt;
    A. Bisection method&lt;br/&gt;
    B. False position&lt;br/&gt;
    C. Newton-Raphson&lt;br/&gt;
    D. Bairsto method&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction13()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo13&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;14.The value of y’/x’ in terms of the angle 0 is given by _____________&lt;br/&gt;
    a) tanθ&lt;br/&gt;
b) secθ&lt;br/&gt;
c) cotθ&lt;br/&gt;
d) cosecθ&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction14()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo14&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;15.The Newton Raphson method is also called as ____________?&lt;br/&gt;
    a) Tangent method&lt;br/&gt;
b) Secant method&lt;br/&gt;
c) Chord method&lt;br/&gt;
d) Diameter method&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction15()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo15&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;16. The equation f(x) is given as x²-4=0. Considering the initial approximation at x=6 then the value of x1 is given as __________&lt;br/&gt;
    a) 10/3&lt;br/&gt;
b) 4/3&lt;br/&gt;
c) 7/3&lt;br/&gt;
d) 13/3&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction16()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo16&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;17.For decreasing the number of iterations in Newton Raphson method.&lt;br/&gt;
    a) The value of f’(x) must be increased&lt;br/&gt;
b) The value of f’’(x) must be decreased&lt;br/&gt;
c) The value of f’(x) must be decreased&lt;br/&gt;
d) The value of f’’(x) must be increased&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction17()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo17&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;18.In Newton Raphson method f’(x) for a given point is given by the formula ____________&lt;br/&gt;
    a) y/x’&lt;br/&gt;
b) y’/x&lt;br/&gt;
c) y/x&lt;br/&gt;
d) y’/x’&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction18()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo18&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;19.If f(x) = x2-117 = 0 then the iterative formula for Newton Raphson Method is given by ____________&lt;br/&gt;
    a) x(n+1)=0.25 [x(n)+166x(n)]&lt;br/&gt;
b) x(n+1)=0.5 [x(n)+166x(n)]&lt;br/&gt;
c) x(n+1)=0.5 [x(n)-166x(n)]&lt;br/&gt;
d) x(n+1)=0.25 [x(n)-166x(n)]&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction19()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo19&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;20.The points where the Newton Raphson method fails are called?&lt;br/&gt;
    a) floating&lt;br/&gt;
b) continuous&lt;br/&gt;
c) non-stationary&lt;br/&gt;
d) stationary&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction20()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo20&quot;&gt;&lt;/p&gt;
&lt;br/&gt;
    &lt;/div&gt;
          
&lt;/div&gt;


    &lt;script&gt;
 
        var clickControl=true;
  
function myFunction1(){
    if(clickControl){
        document.getElementById(&quot;demo1&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br /&gt;Explanation: Rate of convergence of the Newton-Raphson method is generally Linear. It states that the value of root through the Newton Raphson method converges slowly&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo1&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }

}
  function myFunction2(){
  
    if(clickControl){
        document.getElementById(&quot;demo2&quot;).innerHTML=&quot;Answer: c&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo2&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
  }
  
    function myFunction3(){
  
    if(clickControl){
        document.getElementById(&quot;demo3&quot;).innerHTML=&quot;Answer: b&lt;br /&gt;Explanation: The Newton Raphson method involves the guessing of the root. Hence it falls under open methods.&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo3&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
      function myFunction4(){
  
    if(clickControl){
        document.getElementById(&quot;demo4&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo4&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
      }
  
        function myFunction5(){
  
    if(clickControl){
        document.getElementById(&quot;demo5&quot;).innerHTML=&quot;Answer: a&lt;br /&gt;Explanation: The Iterative formula for Newton Raphson method is given by x(1)=x(0)-f(x(0))/f′(x(0)). It depends on the initial value and converges slowly. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo5&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
        }
          
  function myFunction6(){
  
    if(clickControl){
        document.getElementById(&quot;demo6&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &lt;br&gt; &quot; ;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo6&quot;).innerHTML=&quot; &quot;;
       clickControl=!clickControl;
    }
  }
  
            function myFunction7(){
  
    if(clickControl){
        document.getElementById(&quot;demo7&quot;).innerHTML=&quot;Answer: c&lt;br /&gt;Explanation: If the curve f(x) is constant then the slope of the tangent drawn to the curve at an initial point is zero. Hence the value of f’(x) is zero. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo7&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
            }
  
              function myFunction8(){
  
    if(clickControl){
        document.getElementById(&quot;demo8&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo8&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
                function myFunction9(){
  
    if(clickControl){
        document.getElementById(&quot;demo9&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b&lt;br /&gt;Explanation: Iterative formula is given by    x(1) =  x(0)+ f(x(0))/f′x(x(0)) . For f’(x0) at x=90 degrees approaches ∞. Then for all values of x1=x0. Hence if f(x0) = 0 then the tan0=90 degrees.&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo9&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
                  function myFunction10(){
  
    if(clickControl){
        document.getElementById(&quot;demo10&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; d&lt;br /&gt;Explanation: When the consecutive values of iterations are equal the iterations of Newton Raphson method are stopped. This allows maximum accuracy as compared to other methods. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo10&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    }
  
                    function myFunction11(){
  
    if(clickControl){
        document.getElementById(&quot;demo11&quot;).innerHTML=&quot;&lt;b&gt;Answer a&lt;/b&gt; &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo11&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
   }
  
                      function myFunction12(){
  
    if(clickControl){
        document.getElementById(&quot;demo12&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br /&gt;Explanation:When f’(x0) becomes zero then the value of f(x0)/f’(x0) becomes ∞. Hence Newton Raphson method fails at f’(x0)=0. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo12&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
     }
                        function myFunction13(){
  
    if(clickControl){
        document.getElementById(&quot;demo13&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; c &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo13&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
    } 
                     function myFunction14(){
  
    if(clickControl){
        document.getElementById(&quot;demo14&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br /&gt;Explanation: The value of derivative of a function f(x) is given as f’(x)=y’/x’. In terms of theta tangent is the ration of opposite side to adjacent side hence y’/x’=tanθ.&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo14&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
                     }
  
              function myFunction15(){
  
    if(clickControl){
        document.getElementById(&quot;demo15&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br /&gt;Explanation:Newton Raphson method is also known as Tangent Method. It is carried out by drawing a tangent to the curve at the point of initial guess.&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo15&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
              }
                              function myFunction16(){
  
    if(clickControl){
        document.getElementById(&quot;demo16&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br /&gt;Explanation:Iterative formula for Newton Raphson method is given by&lt;br /&gt;x(1)=x(0)+f(x(0))/f′x(x(0)).&lt;br /&gt;Hence x0=6 (initial guess), f(x0)=32 and f’(x0)=12.&lt;br /&gt;Substituting the values in the equation we get x1= 10/3.&quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo16&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
     }
  
    function myFunction17(){
  
    if(clickControl){
        document.getElementById(&quot;demo17&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br /&gt;Explanation: Iterative formula is given by&lt;br /&gt;x(1)=x(0)+f(x(0))/f′x(x(0)).&lt;br /&gt;Hence if f’(x) decreases the value of next iteration approaches the initial one. This decreases the number of iterations in finding out next iterative value. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo17&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
     }
  
       function myFunction18(){
  
    if(clickControl){
        document.getElementById(&quot;demo18&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; d&lt;br /&gt;Explanation: The derivative of a function f(x) is given as f’(x) = y’/x’. It is defined as the slope of the tangent drawn at the point of assumed initial value to the curve.&lt; &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo18&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
  }
  
    function myFunction19(){
  
    if(clickControl){
        document.getElementById(&quot;demo19&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b&lt;br /&gt;Explanation: Consider x(n+1)=0.5 [x(n)+ N/x(n) ]&lt;br /&gt;Where N=117. Hence x(n+1)=0.5 [x(n)+ 117 / x(n) ]. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo19&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
     }
  
    function myFunction20(){
  
    if(clickControl){
        document.getElementById(&quot;demo20&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; d&lt;br /&gt;Explanation: The points where the function f(x) approaches infinity are called as Stationary points. At stationary points Newton Raphson fails and hence it remains undefined for Stationary points. &quot;;
        clickControl=!clickControl;
    }
    else{
        document.getElementById(&quot;demo20&quot;).innerHTML=&quot; &quot;;
        clickControl=!clickControl;
    }
     }
  
&lt;/script&gt;
    

 &lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/2951063437356625874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/04/newton-raphson.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/2951063437356625874'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/2951063437356625874'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/04/newton-raphson.html' title='Newton raphson method multiple choice questions with solutions'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBr4dFnZmCSIsm3jXhbt_ntezWTh_PzS8Tn5aGoCcDsin7LG7pEYcqhracrVFa6YX3aX0m4r30QSySl-BVqWV27KxW347AOdim3SHh21Y2VEjU26__YVVHA615K15ppgFB9wf2GnWX5q4/s72-c/newtons+method-compressed.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>Asia</georss:featurename><georss:point>34.047863 100.6196553</georss:point><georss:box>5.7376291638211541 65.4634053 62.358096836178845 135.7759053</georss:box></entry><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-1900374595034699405</id><published>2021-04-28T01:41:00.022+05:30</published><updated>2021-08-06T14:51:55.923+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="html-css"/><title type='text'>Html and css multiple choice questions</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;title&gt;Html And css multiple choice questions with answers&lt;/title&gt;
      &lt;meta name=&quot;keywords&quot; content=&quot;html, css, programming&quot;/&gt;
      &lt;meta name=&quot;description&quot; content=&quot;html is used to design a webpage while css is used to make a webpage attractive and responsive by using its styling features .&quot;/&gt;

     &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;/&gt;
     &lt;meta charset=&quot;UTF-8&quot; /&gt;
       &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;/&gt;

     &lt;style&gt;
button{
  border:1;
  box-shadow:2px 3px grey;
  background-color:white;
  padding:7px 10px;
        }
        button:hover{
         box-shadow:none;
          background-color:lightblue;
     
        }
      &lt;/style&gt;
      
 &lt;/head&gt;

 &lt;body&gt;
   



&lt;div class=&quot;main&quot;&gt;
    &lt;div class=&quot;content1&quot;&gt;
      &lt;h2&gt;What is web programming?&lt;/h2&gt;
&lt;p&gt;Web programming refers to the writing, markup and coding involved in Web development, which includes Web content, Web client and server scripting and network security. The most common languages used for Web programming are XML,&lt;strong&gt; HTML&lt;/strong&gt;, CSS,JavaScript, Perl5 and PHP.&lt;/p&gt;
       &lt;br/&gt;
       &lt;img class=&quot;center&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4WFcIetXsBZUC_5_hktR8cR_lYWph131t7cJNrKEG0Txw0UXPA06ztAiSV8TAWfP6bjI9wmr3NAIlph2dHGMvRXwlv7EDd1ZvaYun28P40uyxKTmwVlurRcmltu4S1uPotml_0KHJYSE/s16000/web-programming-compressed+%25281%2529.jpg&quot; alt=&quot;web programming&quot;/&gt;

       &lt;ul&gt;
         &lt;li&gt;&lt;h3&gt;What is HTML?&lt;/h3&gt;&lt;/li&gt;
         &lt;p&gt;1.HTML (hyper text markup language) defines what the content to be shown on web page.&lt;br/&gt;
          i.e. It it is use to define the structure of a web page.&lt;br/&gt;
          2.HTML5 is the latest evolution of the standard HTML that defines HTML.&lt;/p&gt;
          &lt;button id=&quot;btn&quot; onclick=&quot;myFunction0()&quot;&gt;READ MORE&lt;/button&gt;
          &lt;p id=&quot;demo0&quot;&gt;&lt;/p&gt;

          &lt;li&gt;&lt;h3&gt;What is CSS?&lt;/h3&gt;&lt;/li&gt;
          &lt;p&gt;1.CSS (cascading style sheet) defines how the content to be shown.&lt;br/&gt;
            i.e. CSS is used to style the web pages using different styling features.&lt;/p&gt;
          &lt;/ul&gt;

          &lt;table&gt;
            &lt;tbody&gt;&lt;tr&gt;
            &lt;th&gt; Types&lt;/th&gt;
            &lt;th&gt; Uses&lt;/th&gt;
            &lt;th&gt;Example&lt;/th&gt;
            &lt;/tr&gt;
            
            &lt;tr&gt;
            &lt;td&gt;Inline&lt;/td&gt;
            &lt;td&gt;An inline CSS is used to apply a unique style to a single HTML element. An inline CSS uses the style attribute of an HTML element.&lt;/td&gt;
            &lt;td&gt; &lt;span&gt;&amp;lt;&lt;/span&gt;h1 style=&quot;color:red&quot;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/td&gt;
            &lt;/tr&gt;
            
            &lt;tr&gt;
            &lt;td&gt;Internal&lt;/td&gt;
            &lt;td&gt;An internal CSS is used to define a style for a single HTML page. An internal CSS is defined in the &lt;head&gt; section of an HTML page, within a &lt;span&gt;&amp;lt;&lt;/span&gt;style&lt;span&gt;&amp;gt;&lt;/span&gt; element&lt;/head&gt;&lt;/td&gt;
            &lt;td&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;style&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;h1&lt;span&gt;{&lt;/span&gt;&lt;br /&gt;   color:red;&lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;/&lt;span&gt;&lt;/span&gt;style&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
            &lt;td&gt;External&lt;/td&gt;
            &lt;td&gt;An external stylesheet is a standalone . css file that is linked from a web page. The advantage of external stylesheets is that it can be created once and the rules applied to multiple web pages.&lt;/td&gt;
            &lt;td&gt; Filename.css&lt;br /&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;style&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;h1&lt;span&gt;{&lt;/span&gt;&lt;br /&gt;   color:red;&lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;/&lt;span&gt;&lt;/span&gt;style&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;/tbody&gt;&lt;/table&gt;
            &lt;br/&gt;

        &lt;h2&gt;Multiple choice questions&lt;/h2&gt;
&lt;h3&gt;HTML and CSS Part-1&lt;/h3&gt;
&lt;p&gt;
1. Which attribute specifies a unique alphanumeric identifier to be associated with an element?&lt;br/&gt;
a) class&lt;br/&gt;
b) id&lt;br/&gt;
c) article&lt;br/&gt;
d) html&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction1()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo1&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;2. The _____________ attribute specifies an inline style associated with an element, which determines the rendering of the affected element.&lt;br/&gt;
a) div&lt;br/&gt;
b) style&lt;br/&gt;
c) class&lt;br/&gt;
d) article&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction2()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo2&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;3. Which attribute is used to provide an advisory text about an element or its contents?&lt;br/&gt;
a) tooltip&lt;br/&gt;
b) dir&lt;br/&gt;
c) title&lt;br/&gt;
d) head&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction3()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo3&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;4. The __________ attribute sets the text direction as related to the lang attribute.&lt;br/&gt;
a) lang&lt;br/&gt;
b) sub&lt;br/&gt;
c) dir&lt;br/&gt;
d) ds&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction4()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo4&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;5. Which of the following is the attribute that specifies the column name from the data source object that supplies the bound data?&lt;br/&gt;
a) dataFormatAs&lt;br/&gt;
b) datafld&lt;br/&gt;
c) disabled&lt;br/&gt;
d) datasrc&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction5()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo5&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;6. Which of the following is the attribute that indicates the name of the data source object that supplies the data that is bound to this element?&lt;br/&gt;
a) dataFormatAs&lt;br/&gt;
b) datafld&lt;br/&gt;
c) disabled&lt;br/&gt;
d) datasrc&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction6()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo6&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;7. Which of the following is the attribute that specifies additional horizontal space, in pixels, to be reserved on either side of an embedded item like an iframe, applet, image, and so on?&lt;br/&gt;
a) height&lt;br/&gt;
b) hspace&lt;br/&gt;
c) hidefocus&lt;br/&gt;
d) datasrc&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction7()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo7&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;h3&gt;HTML and CSS Part-2&lt;/h3&gt;
&lt;p&gt;8. The accesskey attribute specifies a keyboard navigation accelerator for the element.&lt;br/&gt;
a) True&lt;br/&gt;
b) False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction8()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo8&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;9. Which of the following is the attribute that is used to set a global identifier for a microdata item?&lt;br/&gt;
a) key&lt;br/&gt;
b) id&lt;br/&gt;
c) itemclass&lt;br/&gt;
d) itemid&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction9()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo9&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;10. Which of the following is the attribute that is used to add a name/value pair to a microdata item?&lt;br/&gt;
a) itemscope&lt;br/&gt;
b) itemref&lt;br/&gt;
c) itemprop&lt;br/&gt;
d) itemid&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction10()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo10&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;11. With which element width attribute is not define?&lt;br/&gt;
a) &amp;lt;input&amp;gt;&lt;br/&gt;
b) &amp;lt;object&amp;gt;&lt;br/&gt;
c) &amp;lt;embed&amp;gt;&lt;br/&gt;
d) &amp;lt;textarea&amp;gt;&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction11()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo11&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;12. Which of the following defines a default value on page load?&lt;br/&gt;
a) &amp;lt;object&amp;gt;&lt;br/&gt;
b) &amp;lt;input&amp;gt;&lt;br/&gt;
c) &amp;lt;progress&amp;gt;&lt;br/&gt;
d) &amp;lt;area&amp;gt;&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction12()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo12&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;13. Which attribute is not for overriding the actions?&lt;br/&gt;
a) Formaction&lt;br/&gt;
b) Style&lt;br/&gt;
c) Tabindex&lt;br/&gt;
d) Slot&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction13()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo13&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;14. srclang attribute is used with the element ____________&lt;br/&gt;
    a) &lt;track&gt;&lt;br/&gt;
b) &amp;lt;input&amp;gt;&lt;br/&gt;
c) &amp;lt;iframe&amp;gt;&lt;br/&gt;
d) &amp;lt;table&amp;gt;&lt;br/&gt;
    &lt;button id=&quot;btn&quot; onclick=&quot;myFunction14()&quot;&gt;ANSWER&lt;/button&gt;
  &lt;/p&gt;
    &lt;p id=&quot;demo14&quot;&gt;&lt;/p&gt;
    &lt;br/&gt;


&lt;p&gt;15. Which parameter is commonly used for size attribute?&lt;br/&gt;
    a) centimeter&lt;br/&gt;
    b) pixels&lt;br/&gt;
c) inch&lt;br/&gt;
d) millimeter&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction15()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
    &lt;p id=&quot;demo15&quot;&gt;&lt;/p&gt;
    &lt;br/&gt;


&lt;p&gt;16. Which attribute indicates a descending order of displaying a list?&lt;br/&gt;
a) reversed&lt;br/&gt;
b) forward&lt;br/&gt;
c) straight&lt;br/&gt;
d) circular&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction16()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
    &lt;p id=&quot;demo16&quot;&gt;&lt;/p&gt;
    &lt;br/&gt;


    &lt;/div&gt;
          
&lt;/div&gt;




&lt;script&gt;
  var clickControl=true;
  
  function myFunction0(){
   if(clickControl){
    document.getElementById(&quot;demo0&quot;).innerHTML=&quot;In short, HTML5 is special because it makes the Internet better. It seeks to improve the way the web works and performs, making it easier for developers to create terrific sites and making it more efficient for users to experience those sites regardless of the browser or platform they are using.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo0&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
  
   function myFunction1(){
   if(clickControl){
    document.getElementById(&quot;demo1&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Explanation: HTML is Hyper Text Markup Language which is used to create web pages and applications. The id attribute is most used to point to a style in a style sheet, and by JavaScript (via the HTML DOM) to manipulate the element with the specific id. Class is a name given to HTML elements which can be used by CSS and JavaScript for styling the web pages. A self-contained content is called attribute.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo1&quot;).innerHTML=&quot; &quot;
      clickControl=!clickControl;
    }
  }
   function myFunction2(){
   if(clickControl){
    document.getElementById(&quot;demo2&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Explanation: Style attribute specifies an inline style for an element. The style attribute will override any style set globally, e.g. styles specified in the style tag or in an external style sheet. A self-contained content is called attribute. Class is a name given to HTML elements which can be used by CSS and JavaScript for styling the web pages. List of directory files is given by dir tag which is not supported in HTML5.&quot;; 
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo2&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction3(){
   if(clickControl){
    document.getElementById(&quot;demo3&quot;).innerHTML=&quot;&lt;b&gt;Answer: c&lt;/b&gt;&lt;br/&gt;Explanation: The extra information about an element is specified by title tag. The information is most often shown as a tooltip text when the mouse moves over the element. List of directory files is given by dir tag which is not supported in HTML5. Tooltip or else infotip is a graphical user interface of an element. Container of metadata is called head.&quot;; 
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo3&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction4(){
   if(clickControl){
    document.getElementById(&quot;demo4&quot;).innerHTML=&quot;&lt;b&gt;Answer: c&lt;/b&gt;&lt;br/&gt;Explanation: The dir attribute specifies the text direction of the element’s content. List of directory files is given by dir tag which is not supported in HTML5. The language of an element’s content is given by lang attribute. The subscript text is defined by sub attribute.&quot;; 
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo4&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction5(){
   if(clickControl){
    document.getElementById(&quot;demo5&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Explanation: DataFormatAs specifies how data is rendered. The identifier for data source is set by dataSrc.Datafld attribute specifies the column name from the data source object that supplies the bound data.This attribute is specific to Microsoft’s data binding. A Disabled is a boolean attribute which specifies that &lt;span&gt;&lt;&lt;/span&gt;input&lt;span&gt;&gt;&lt;/span&gt; element should be disabled.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo5&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction6(){
   if(clickControl){
    document.getElementById(&quot;demo6&quot;).innerHTML=&quot;&lt;b&gt;Answer: d&lt;/b&gt;&lt;br/&gt;Explanation: The identifier for data source is set by dataSrc. When the dataSrc property is applied to a tabular data consumer, the entire data set is repeated by the consuming elements. DataFormatAs specifies how data is rendered. A Disabled is a boolean attribute which specifies that &lt;span&gt;&lt;&lt;/span&gt;input&lt;span&gt;&gt;&lt;/span&gt; element should be disabled.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo6&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction7(){
   if(clickControl){
    document.getElementById(&quot;demo7&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Explanation: Height of element is pixels is specified by height attribute. The hspace attribute specifies the whitespace on left and right side of an object. The hidefocus specifies whether a focused rectangle is drawn around an object. The identifier for data source is set by dataSrc.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo7&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction8(){
   if(clickControl){
    document.getElementById(&quot;demo8&quot;).innerHTML=&quot;&lt;b&gt;Answer: a&lt;/b&gt;&lt;br/&gt;Explanation: The accesskey attribute specifies a shortcut key to activate/focus an element. It specifies a keyboard navigation accelerator for the element. We can use accesskey attribute in forms or links.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo8&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction9(){
   if(clickControl){
    document.getElementById(&quot;demo9&quot;).innerHTML=&quot;&lt;b&gt;Answer: d&lt;/b&gt;&lt;br/&gt;Explanation: The unique id for an element in html is specified by id attribute. Itemmid allows a vocabulary to define a global identifier for a microdata item, for example an ISBN number on a book. Use itemid on the same element as the item’s itemscope and itemtype attributes.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo9&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction10(){
   if(clickControl){
    document.getElementById(&quot;demo10&quot;).innerHTML=&quot;&lt;b&gt;Answer: c&lt;/b&gt;&lt;br/&gt;Explanation: A boolean global attribute which specifies scope of associated metadata is itemscope. Itemmid is unique global identifier of item. To add a property to an item, the itemprop attribute is used on one of the item’s descendants. Markup without the microdata-related attributes does not have any effect on the microdata model. Itemref provides list of elements id’s with extra/additional properties in the document.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo10&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction11(){
   if(clickControl){
    document.getElementById(&quot;demo11&quot;).innerHTML=&quot;&lt;b&gt;Answer: d&lt;/b&gt;&lt;br/&gt;Explanation: width attribute is defined with &amp;lt;object&amp;gt;, &amp;lt;iframe&amp;gt;, &amp;lt;img&amp;gt;, &amp;lt;video&amp;gt;, &amp;lt;canvas&amp;gt;, &amp;lt;embed&amp;gt;, &amp;lt;input&amp;gt;.&amp;lt;textarea&amp;gt; is used commonly with autofocus, cols, dirname, disabled, form, maxlength, minlength, name, placeholder, readonly, rows and many other attributes.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo11&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction12(){
   if(clickControl){
    document.getElementById(&quot;demo12&quot;).innerHTML=&quot;&lt;b&gt;Answer: c&lt;/b&gt;&lt;br/&gt;Explanation: &amp;lt;button&amp;gt;, &amp;ltli&amp;gt;, &amp;ltprogress&amp;gt;, &amp;lt;param&amp;gt;, &amp;lt;meter&amp;gt;, &amp;lt;input&amp;gt;, &amp;lt;option&amp;gt; are some elements used with value attribute and defines a default value on the page load.&amp;lt;object&amp;gt; element is used with many attributes like border, data, form, height etc. &lt;area&gt; is used with attributes like alt, cords, download, href, hreflang and many more.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo12&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction13(){
   if(clickControl){
    document.getElementById(&quot;demo13&quot;).innerHTML=&quot;&lt;b&gt;Answer: d&lt;/b&gt;&lt;br/&gt;Explanation: formaction is used for overriding &lt;form&gt; action, style is a global attribute that overrides previously set styles, tabindex is also a global attribute which overrides default tab order. A slot is a global attribute which assigns a slot in a shadow.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo13&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction14(){
   if(clickControl){
    document.getElementById(&quot;demo14&quot;).innerHTML=&quot;&lt;b&gt;Answer: a&lt;/b&gt;&lt;br/&gt;Explanation: srclang attribute is used with &amp;lt;track&amp;gt;. It specifies the language of text. E.g &lt;track src=”xyz.ogg” srclang=”en” label=”English”&gt;, &amp;lt;input&amp;gt; is used with many attributes like accept, alt, async, autocomplete, autofocus, checked, dirname, disabled, form, formaction, height, list and many more.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo14&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
   function myFunction15(){
   if(clickControl){
    document.getElementById(&quot;demo15&quot;).innerHTML=&quot;&lt;b&gt;Answer: b&lt;/b&gt;&lt;br/&gt;Explanation: Size is an attribute commonly used with &amp;lt;input&amp;gt; and &amp;lt;select&amp;gt; element, it defines the width of element in pixels. If we have password or text as attribute then it will be count number of characters. Sizes is a attribute use with &amp;lt;link&amp;gt;, &amp;lt;source&amp;gt;, &amp;lt;img&amp;gt;&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo15&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
  
    function myFunction16(){
   if(clickControl){
    document.getElementById(&quot;demo16&quot;).innerHTML=&quot;&lt;b&gt;Answer: a&lt;/b&gt;&lt;br/&gt;Explanation: Reverse attribute commonly use with &amp;lt;ol&amp;gt; element. It indicates that if the list is to be displayed in descending order instead of ascending order or not. There is no reference for options like forward, straight and circular in HTML.&quot;;
     clickControl=!clickControl;
   }
    else{
     document.getElementById(&quot;demo16&quot;).innerHTML=&quot; &quot;;
      clickControl=!clickControl;
    }
  }
&lt;/script&gt;


 &lt;/body&gt;
&lt;/html&gt;</content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/1900374595034699405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/04/html-css.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/1900374595034699405'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/1900374595034699405'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/04/html-css.html' title='Html and css multiple choice questions'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4WFcIetXsBZUC_5_hktR8cR_lYWph131t7cJNrKEG0Txw0UXPA06ztAiSV8TAWfP6bjI9wmr3NAIlph2dHGMvRXwlv7EDd1ZvaYun28P40uyxKTmwVlurRcmltu4S1uPotml_0KHJYSE/s72-c/web-programming-compressed+%25281%2529.jpg" height="72" width="72"/><thr:total>0</thr:total><georss:featurename>India</georss:featurename><georss:point>20.593684 78.96288</georss:point><georss:box>-10.835813217639252 43.806627317790984 52.023181217639248 114.11913268220901</georss:box></entry><entry><id>tag:blogger.com,1999:blog-919299427379495628.post-7351689929713573286</id><published>2021-04-28T01:09:00.028+05:30</published><updated>2021-08-06T14:52:28.805+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bisection method"/><title type='text'>Bisection method multiple choice questions with answers</title><content type='html'>&lt;!DOCTYPE html&gt;
 &lt;html lang=&quot;en-US&quot;&gt;
  &lt;head&gt;
      &lt;title&gt;Bisection method multiple choice questions with answers&lt;/title&gt;
      &lt;meta name=&quot;keywords&quot; content=&quot;bisection, bracketing, method, analysis, numerical, root&quot;/&gt;
      &lt;meta content=&quot;IE=edge&quot; http-equiv=&quot;X-UA-Compatible&quot;&gt;
      &lt;meta name=&quot;description&quot; content=&quot;Bisection method is a bracketing method which is use to find root for mathematical equations.&quot;/&gt;
      
      &lt;link href=&quot;https://itseassyy.blogspot.com/2021/04/bisection-method.html&quot; hreflang=&quot;en&quot; rel=&quot;alternate&quot;&gt;

     &lt;meta charset=&quot;UTF-8&quot; /&gt;
       &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;/&gt;

     &lt;style&gt;
button{
  border:1;
  box-shadow:2px 3px grey;
  background-color:white;
  padding:7px 10px;
        }
        button:hover{
         box-shadow:none;
          background-color:lightblue;
     
        }
      &lt;/style&gt;

&lt;script type=&quot;application/ld+json&quot;&gt;{
    &quot;@context&quot;: &quot;https://schema.org&quot;,
    &quot;@graph&quot;: [
        {
            &quot;@type&quot;: &quot;Organization&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/#organization&quot;,
            &quot;name&quot;: &quot;ITs Easy&quot;,
            &quot;url&quot;: &quot;https://itseassyy.blogspot.com&quot;,
            &quot;logo&quot;: {
                &quot;@type&quot;: &quot;ImageObject&quot;,
                &quot;url&quot;: &quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1tSjmdGbnZSls2eR6vnspuqt8zQuYKsM6nJx3wekenOxe8FDxKu1bfc1IRaU4LeVxqlAIjNeqwviAgxEk-6oHGCElryXY5U6manmUVihGzjtL6giixmBXrP3m7_NDPF4yqEjgUeE-z8U/w400-h266/ITs+Easy+logo.jpg&quot;
            }
        },
        {
            &quot;@type&quot;: &quot;WebSite&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/#website&quot;,
            &quot;url&quot;: &quot;https://itseassyy.blogspot.com&quot;,
            &quot;name&quot;: &quot;ITs Easy&quot;,
            &quot;publisher&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/#organization&quot;
            },
            &quot;inLanguage&quot;: &quot;en-US&quot;,
            &quot;potentialAction&quot;: {
                &quot;@type&quot;: &quot;SearchAction&quot;,
                &quot;target&quot;: &quot;https://itseassyy.blogspot.com/?s={search_term_string}&quot;,
                &quot;query-input&quot;: &quot;required name=search_term_string&quot;
            }
        },
        {
            &quot;@type&quot;: &quot;ImageObject&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#primaryImage&quot;,
            &quot;url&quot;: &quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijz01kSQdnJ91ToCUo6Ee1ujX08NWdcTgZs7aOK_1gIBh5RzMkdvBPYX280wl0zZDk1Ix6CmKJs6HpysOpXUPjeF1LDIfaeRYS5tZ38s9Uj93Vz7NIrZVXubjESg_RHoVbCQicPIwbvuU/s400/bisection-method.jpg?fit=745,483&amp;ssl=1&quot;,
            &quot;width&quot;: 745,
            &quot;height&quot;: 483
        },
        {
            &quot;@type&quot;: &quot;BreadcrumbList&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#breadcrumb&quot;,
            &quot;itemListElement&quot;: [
                {
                    &quot;@type&quot;: &quot;ListItem&quot;,
                    &quot;position&quot;: 1,
                    &quot;item&quot;: {
                        &quot;@id&quot;: &quot;https://itseassyy.blogspot.com&quot;,
                        &quot;name&quot;: &quot;Home&quot;
                    }
                },
                {
                    &quot;@type&quot;: &quot;ListItem&quot;,
                    &quot;position&quot;: 2,
                    &quot;item&quot;: {
                        &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/&quot;,
                        &quot;name&quot;: &quot;Bisection method questions and solutions with explanation&quot;
                    }
                }
            ]
        },
        {
            &quot;@type&quot;: &quot;WebPage&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#webpage&quot;,
            &quot;url&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html&quot;,
            &quot;name&quot;: &quot;Numerical analysis - Bisection Method mcq questions | ITs Easy&quot;,
            &quot;datePublished&quot;: &quot;2021-03-18T11:18:27+00:00&quot;,
            &quot;dateModified&quot;: &quot;2021-04-07T15:11:55+00:00&quot;,
            &quot;isPartOf&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/#website&quot;
            },
            &quot;primaryImageOfPage&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#primaryImage&quot;
            },
            &quot;inLanguage&quot;: &quot;en-US&quot;,
            &quot;breadcrumb&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#breadcrumb&quot;
            }
        },
        {
            &quot;@type&quot;: &quot;BlogPosting&quot;,
            &quot;headline&quot;: &quot;Bisection method questions and solutions with explanation | ITs Easy&quot;,
            &quot;datePublished&quot;: &quot;2021-03-18T11:18:27+00:00&quot;,
            &quot;dateModified&quot;: &quot;2021-04-07T15:11:55+00:00&quot;,
            &quot;author&quot;: {
                &quot;@type&quot;: &quot;Person&quot;,
                &quot;name&quot;: &quot;ITs Easy&quot;
            },
            &quot;publisher&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/#organization&quot;
            },
            &quot;description&quot;: &quot;ITs Easy helps students to rich their goals with there efforts and brain power&quot;,
            &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#richSnippet&quot;,
            &quot;isPartOf&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#webpage&quot;
            },
            &quot;image&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#primaryImage&quot;
            },
            &quot;inLanguage&quot;: &quot;en-US&quot;,
            &quot;mainEntityOfPage&quot;: {
                &quot;@id&quot;: &quot;https://itseassyy.blogspot.com/2021/03/numerical-analysis-bisection-method-mcq.html#webpage&quot;
            }
        }
    ]
}&lt;/script&gt;
  
   &lt;script type=&quot;application/ld+json&quot;&gt;
    {
      &quot;@context&quot;: &quot;https://schema.org/&quot;,
      &quot;@type&quot;: &quot;Quiz&quot;,
      &quot;typicalAgeRange&quot;: &quot;7-12&quot;,
      &quot;educationalLevel&quot;: &quot;intermediate&quot;,
      &quot;assesses&quot;: &quot;Numerical methods and statistics&quot;,
      &quot;educationalAlignment&quot;: [
        {
          &quot;@type&quot;: &quot;AlignmentObject&quot;,
          &quot;alignmentType&quot;: &quot;educationalSubject&quot;,
          &quot;targetName&quot;: &quot;Mathematics&quot;
        },
        {
          &quot;@type&quot;: &quot;AlignmentObject&quot;,
          &quot;alignmentType&quot;: &quot;educationalSubject&quot;,
          &quot;targetName&quot;: &quot;Bisection methods&quot;
        }
      ],
      &quot;name&quot;: &quot;Quiz about bisection method in numerical analysis and statistics&quot;,
      &quot;about&quot;: {
        &quot;@type&quot;: &quot;Thing&quot;,
        &quot;name&quot;: &quot; Bisection method Numerical analysis and statistics&quot;
      },
      &quot;hasPart&quot;: [
        {
          &quot;@type&quot;: &quot;Question&quot;,
          &quot;eduQuestionType&quot;: &quot;Multiple choice&quot;,
          &quot;learningResourceType&quot;: &quot;Practice problem&quot;,
          &quot;name&quot;: &quot;Question on Bisection method in numerical analysis&quot;,
          &quot;text&quot;: &quot; 4. The Bisection method is also known as___________ &quot;,
          &quot;comment&quot;: {
            &quot;@type&quot;: &quot;Comment&quot;,
            &quot;text&quot;: &quot;&quot;
          },
          &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
          &quot;suggestedAnswer&quot;: [
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 0,
              &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
              &quot;text&quot;: &quot;a) Hex region Chopping&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;Sorry, Incorect!&quot;
              }
            },
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 1,
              &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
              &quot;text&quot;: &quot;b) Quaternary Chopping&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;Sorry, Incorrect!&quot;
              }
            },
               {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 2,
              &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
              &quot;text&quot;: &quot;c) Tri region Chopping&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;Sorry, Incorrect!&quot;
              }
            }
          ],
          &quot;acceptedAnswer&quot;: {
            &quot;@type&quot;: &quot;Answer&quot;,
            &quot;position&quot;: 3,
            &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
            &quot;text&quot;: &quot;d) Binary chopping&quot;,
            &quot;comment&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Great job&quot;
            },
            &quot;answerExplanation&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Bisection Method is also called as Binary Chopping. It is a method involving the division of the interval into half.&quot;
            }
          }
        },
        {
          &quot;@type&quot;: &quot;Question&quot;,
          &quot;eduQuestionType&quot;: &quot;Multiple choice&quot;,
          &quot;learningResourceType&quot;: &quot;Practice problem&quot;,
          &quot;name&quot;: &quot;Secant method in numerical methods &quot;,
          &quot;text&quot;: &quot;10.Which of the following statements applies to the bisection method used for finding roots of functions?&quot;,
          &quot;encodingFormat&quot;: &quot;text/markdown&quot;,
          &quot;comment&quot;: {
            &quot;@type&quot;: &quot;Comment&quot;,
            &quot;text&quot;: &quot;&quot;
          },
          &quot;suggestedAnswer&quot;: [
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 0,
              &quot;text&quot;: &quot;a.Converges within a few iterations&quot;,
              &quot;encodingFormat&quot;: &quot;text/html&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;Sorry, Incorrect!&quot;
              }
            },
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 1,
              &quot;text&quot;: &quot;b.Is faster than the Newton-Raphson method&quot;,
              &quot;encodingFormat&quot;: &quot;text/html&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;Sorry, Incorrect!&quot;
              }
            },
            {
              &quot;@type&quot;: &quot;Answer&quot;,
              &quot;position&quot;: 2,
              &quot;text&quot;: &quot;d.Requires that there be no error in determining the sign of the function&quot;,
              &quot;encodingFormat&quot;: &quot;text/html&quot;,
              &quot;comment&quot;: {
                &quot;@type&quot;: &quot;Comment&quot;,
                &quot;text&quot;: &quot;Sorry, Incorrect!&quot;
              }
            }
          ],
          &quot;acceptedAnswer&quot;: {
            &quot;@type&quot;: &quot;Answer&quot;,
            &quot;position&quot;: 3,
            &quot;text&quot;: &quot;d.Guaranteed to work for all continuous functions&quot;,
            &quot;encodingFormat&quot;: &quot;text/html&quot;,
            &quot;comment&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Correct Answer!&quot;
            },
            &quot;answerExplanation&quot;: {
              &quot;@type&quot;: &quot;Comment&quot;,
              &quot;text&quot;: &quot;Great Job!&quot;
            }
          }
        }
      ]
    }
    &lt;/script&gt;
 
 &lt;/head&gt;

 &lt;body&gt;
   

&lt;div class=&quot;main&quot;&gt;
    &lt;div class=&quot;content1&quot;&gt;
      &lt;h2&gt;What is bisection method?&lt;/h2&gt;
&lt;p&gt;In mathematics, the bisection method is a root-finding method that applies to any continuous functions for which one knows two values with opposite signs&lt;br/&gt;
    The bisection method is used to find the roots of a polynomial equation.&lt;br/&gt;
    • It separates the interval and subdivides the interval in which the root of the equation lies. &lt;br/&gt;
   &lt;/p&gt;
       
       &lt;img class=&quot;center&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijz01kSQdnJ91ToCUo6Ee1ujX08NWdcTgZs7aOK_1gIBh5RzMkdvBPYX280wl0zZDk1Ix6CmKJs6HpysOpXUPjeF1LDIfaeRYS5tZ38s9Uj93Vz7NIrZVXubjESg_RHoVbCQicPIwbvuU/s400/bisection-method.jpg&quot; alt=&quot;mathematics related cover photo sorry it didn&#39;t loaded&quot;&gt;
      
     &lt;p&gt;• The principle behind this method is the intermediate theorem for continuous functions.&lt;br/&gt;
       • It works by narrowing the gap between the positive and negative intervals until it closes in on the correct answer.&lt;br/&gt;
       • This method narrows the gap by taking the average of the positive and negative intervals.&lt;br/&gt;
       • It is a simple method and it is relatively slow. The bisection method is also known as interval halving method, root-finding method, binary search method or dichotomy method.&lt;/p&gt;


        &lt;h2&gt;Multiple choice questions&lt;/h2&gt;
&lt;p&gt;
    1. If a function is real and continuous in the region from a to b and f(a) and f(b) have opposite signs then there is no real root between a and b.&lt;br/&gt;
a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction1()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo1&quot;&gt;&lt;/p&gt;

&lt;br/&gt;


&lt;p&gt;2. A function is given by x – e^-x = 0. Find the root between a = 0 and b =1 by using Bisection method.&lt;br/&gt;
    a) 0.655&lt;br/&gt;
    b) 0.665&lt;br/&gt;
    c) 0.565&lt;br/&gt;
    d) 0.656&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction2()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo2&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;3. Use Bisection Method to find out the root of x – sinx – 0.5 = 0 between 1 and 2.&lt;br/&gt;
    a) 1.497&lt;br/&gt;
b) 1.947&lt;br/&gt;
c) 1.479&lt;br/&gt;
d) 1.974&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction3()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo3&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;4. The Bisection method is also known as ___________________.&lt;br/&gt;
    a) Binary Chopping&lt;br/&gt;
    b) Quaternary Chopping&lt;br/&gt;
    c) Tri region Chopping&lt;br/&gt;
    d) Hex region Chopping&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction4()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo4&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;5. The function on which we use the bisection method is not necessary to be continuous on the interval we choose.&lt;br/&gt;
    a)True&lt;br/&gt;
    b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction5()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo5&quot;&gt;&lt;/p&gt;
&lt;br/&gt;


&lt;p&gt;6.If it is provided that f(3) = 4 is one of the initial points. What can be the choice of second point for solving by Bisection Method?&lt;br/&gt;
    a) -5 such that f(-5) = -26&lt;br/&gt;
    b) 0 such that f(0) = 5&lt;br/&gt;
    c) -3 such that f(-3) = -2&lt;br/&gt;
    d) 13 such that f(13) = 2&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction6()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo6&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;7.What is the percentage decrease in an interval containing root after iteration is applied by Bisection Method?&lt;br/&gt;
 a) 20%&lt;br/&gt;
    b) 30%&lt;br/&gt;
    c) 40%&lt;br/&gt;
    d) 50%&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction7()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo7&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;8.The algorithm provided to find the roots of the function using Bisection Method is given by ____________&lt;br/&gt;
    a) Bolzano’s theorem&lt;br/&gt;
    b) Mean Value theorem&lt;br/&gt;
    c) Bisection theorem&lt;br/&gt;
    d) Secant theorem&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction8()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo8&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;9. The Bisection method has which of the following convergences?&lt;br/&gt;
    a) Linear&lt;br/&gt;
    b) Quadratic&lt;br/&gt;
    c) Cubic&lt;br/&gt;
    d) Quaternary&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction9()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo9&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;10.Which of the following statements applies to the bisection method used for finding roots of functions?&lt;br/&gt;
    a.Converges within a few iterations&lt;br/&gt;
    b.Guaranteed to work for all continuous functions&lt;br/&gt;
    c.Is faster than the Newton-Raphson method&lt;br/&gt;
    d.Requires that there be no error in determining the sign of the function&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction10()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo10&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;11.Using Bisection method, negative root of x^3 - 4x + 9 = 0 correct to three decimal places is&lt;br/&gt;
    a. -2.506&lt;br/&gt;
    b. -2.706&lt;br/&gt;
    c. - 2.406&lt;br/&gt;
    d. None of these&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction11()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo11&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;12.2 and 4 such that f(2) = 4 and f(4) = 16 are appropriate initial points for the bisection method.&lt;br/&gt;
    a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction12()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo12&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;13.Using Bisection method find the root of cos(x) – x * e^x = 0 with a = 0 and b = 1.&lt;br/&gt;
    a) 0.617&lt;br/&gt;
    b) 0.527&lt;br/&gt;
    c) 0.517&lt;br/&gt;
    d) 0.717&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction13()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo13&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;14. Find the root of x^4-x-10 = 0 approximately upto 5 iterations using Bisection Method. Let a = 1.5 and b = 2.&lt;br/&gt;
    a) 1.68&lt;br/&gt;
    b) 1.86&lt;br/&gt;
    c) 1.88&lt;br/&gt;
    d) 1.66&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction14()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo14&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;15. Use Bisection Method to find out the root of x – sinx – 0.5 = 0 between 1 and 2.&lt;br/&gt;
    a) 1.497&lt;br/&gt;
    b) 1.947&lt;br/&gt;
    c) 1.479&lt;br/&gt;
    d) 1.974&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction15()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo15&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;16.Find the approximated value of x till 4 iterations for e^(-x) = 3 log(x) using Bisection Method&lt;br/&gt;
    a) 1.197&lt;br/&gt;
    b) 1.187&lt;br/&gt;
    c) 1.167&lt;br/&gt;
    d) 1.176&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction16()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo16&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;17.Using Bisection method find the root of 3x^(2) = 5x+2 in the interval [0,3].&lt;br/&gt;
    a) 0.617&lt;br/&gt;
b) 0.527&lt;br/&gt;
c) 0.517&lt;br/&gt;
d) 0.717&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction17()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo17&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

&lt;p&gt;18. If a function is defined at 2 points 3 and 7 as f(3)=8 and f(7)=12, it is sufficient to find the roots through Bisection Method.&lt;br/&gt;
    a)True&lt;br/&gt;
b)False&lt;br/&gt;
&lt;button id=&quot;btn&quot; onclick=&quot;myFunction18()&quot;&gt;ANSWER&lt;/button&gt;
&lt;/p&gt;
&lt;p id=&quot;demo18&quot;&gt;&lt;/p&gt;
&lt;br/&gt;

    &lt;/div&gt;

  
          
&lt;/div&gt;

   &lt;script&gt;
 
    var clickControl=true;

function myFunction1(){
if(clickControl){
    document.getElementById(&quot;demo1&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; If a function is real and continuous in the region from a to b and f(a) and f(b) and if both have different signs then there is at least one real root between a and b. This is because the function has to cross the x-axis at least once.&quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo1&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}

}
function myFunction2(){

if(clickControl){
    document.getElementById(&quot;demo2&quot;).innerHTML=&quot;Answer: c&quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo2&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}

function myFunction3(){

if(clickControl){
    document.getElementById(&quot;demo3&quot;).innerHTML=&quot;Answer: a&quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo3&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}

  function myFunction4(){

if(clickControl){
    document.getElementById(&quot;demo4&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a&lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; Bisection Method is also called as Binary Chopping. It is a method involving the division of the interval into half. &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo4&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
  }

    function myFunction5(){

if(clickControl){
    document.getElementById(&quot;demo5&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; The Bisection Method states that function under Bisection Method must be continuous on the interval on which the Bisection Method is applied. Moreover the function has to be a real valued to be able to find the roots by Bisection Method. &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo5&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
    }
      
function myFunction6(){

if(clickControl){
    document.getElementById(&quot;demo6&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; c &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; The Bisection Method involves the procedure of solving a numerical through a bracketing method. This involves defining 2 points where a bracket is small enough and such that f(x) crosses the x-axis at least once in that interval. Hence option -3 such that f(-3) = -2 is more convenient. &quot; ;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo6&quot;).innerHTML=&quot; &quot;;
   clickControl=!clickControl;
}
}

        function myFunction7(){

if(clickControl){
    document.getElementById(&quot;demo7&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; d &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; The Bisection Method employs the reduction of any interval by 50% after each iteration. Hence it is also called as Binary Reduction method. &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo7&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
        }

          function myFunction8(){

if(clickControl){
    document.getElementById(&quot;demo8&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; The Bolzano’s theorem states that if a function is real and continuous in the region from a to b and f(a) and f(b) and if both have different signs then there is at least one real root between a and b. This principle or algorithm is used to find the roots of function using Bisection Method. &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo8&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}

            function myFunction9(){

if(clickControl){
    document.getElementById(&quot;demo9&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; Bisection Method has a linear convergence. It is generally ½ for most functions.&quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo9&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}

              function myFunction10(){

if(clickControl){
    document.getElementById(&quot;demo10&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo10&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}

                function myFunction11(){

if(clickControl){
    document.getElementById(&quot;demo11&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo11&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}

                  function myFunction12(){

if(clickControl){
    document.getElementById(&quot;demo12&quot;).innerHTML=&quot;&lt;b&gt;Answer&lt;/b&gt; b &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo12&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
 }
                    function myFunction13(){

if(clickControl){
    document.getElementById(&quot;demo13&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; c &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo13&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
} 
                 function myFunction14(){

if(clickControl){
    document.getElementById(&quot;demo14&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo14&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
                 }

          function myFunction15(){

if(clickControl){
    document.getElementById(&quot;demo15&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; a &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo15&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
          }
                          function myFunction16(){

if(clickControl){
    document.getElementById(&quot;demo16&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo16&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
 }

function myFunction17(){

if(clickControl){
    document.getElementById(&quot;demo17&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo17&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
 }

   function myFunction18(){

if(clickControl){
    document.getElementById(&quot;demo18&quot;).innerHTML=&quot;&lt;b&gt;Answer:&lt;/b&gt; b &lt;br&gt;&lt;b&gt;Explanation:&lt;/b&gt; If a function is real and continuous in the region from a to b and f(a) and f(b) and if both have different signs then there is at least one real root between a and b. This is because the function has to cross the x-axis at least once. The given values are both positive so it is insufficient to find out the roots through Bisection method &quot;;
    clickControl=!clickControl;
}
else{
    document.getElementById(&quot;demo18&quot;).innerHTML=&quot; &quot;;
    clickControl=!clickControl;
}
}
&lt;/script&gt;


 &lt;/body&gt;
&lt;/html&gt; </content><link rel='replies' type='application/atom+xml' href='https://itseassyy.blogspot.com/feeds/7351689929713573286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://itseassyy.blogspot.com/2021/04/bisection-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/7351689929713573286'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/919299427379495628/posts/default/7351689929713573286'/><link rel='alternate' type='text/html' href='https://itseassyy.blogspot.com/2021/04/bisection-method.html' title='Bisection method multiple choice questions with answers'/><author><name>Suraj Maurya</name><uri>http://www.blogger.com/profile/05872043822211857500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>India</georss:featurename><georss:point>20.593684 78.96288</georss:point><georss:box>-7.7165498361788458 43.80663 48.903917836178849 114.11913</georss:box></entry></feed>