{"id":174,"date":"2020-07-02T17:30:36","date_gmt":"2020-07-02T17:30:36","guid":{"rendered":"\/?p=174"},"modified":"2020-07-04T11:11:08","modified_gmt":"2020-07-04T11:11:08","slug":"2061","status":"publish","type":"post","link":"http:\/\/suryaprakash.com.np\/?p=174","title":{"rendered":"HSEB-2061"},"content":{"rendered":"<p>\/\/HSEB or NEB<br \/>\/\/year 2061(2004)<br \/>\/*Q.1(a).The marks obtained by studen in 7 different subjects are entered through the keyboard. The student gets a division as per the following rules:<br \/>percentage greater of equal to 60 first Division<br \/>percentage between 45 and 59 second Division<br \/>Percentage between 35 and 44 Third Division<br \/>Percentage less than 35 Fail<br \/>percentage less than 35 in a subject will be declared as Fail.<br \/>write a program using C language to process result of all students based on the specification stated above.<br \/>*\/<br \/><span style=\"color: #333399;\">#include&lt;stdio.h&gt;<\/span><br \/><span style=\"color: #333399;\">void main()<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">int marks[7],i,Total=0;<\/span><br \/><span style=\"color: #333399;\">float av;<\/span><br \/><span style=\"color: #333399;\">printf(&#8220;enter the marks of 7 subjects:\\n&#8221;);<\/span><br \/><span style=\"color: #333399;\">for(i=0;i&lt;7;i++)<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">scanf(&#8220;%d&#8221;,&amp;marks[i]);<\/span><br \/><span style=\"color: #333399;\">Total+=marks[i];<\/span><br \/><span style=\"color: #333399;\">}<\/span><br \/><span style=\"color: #333399;\">av=Total\/7.0;<\/span><br \/><span style=\"color: #333399;\">if(av&gt;=35)<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">for(i=0;i&lt;7;i++)<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">if(marks[i]&lt;35)<\/span><br \/><span style=\"color: #333399;\">break;<\/span><br \/><span style=\"color: #333399;\">}<\/span><br \/><span style=\"color: #333399;\">if(i==7)<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">if(av&gt;=60)<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">printf(&#8220;Passed with First Division with %f percent.&#8221;,av);<\/span><br \/><span style=\"color: #333399;\">}<\/span><br \/><span style=\"color: #333399;\">else if(av&gt;=45 &amp;&amp; av&lt;=59)<\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">printf(&#8220;Passed with Second Division with %f percent&#8221;,av);<\/span><br \/><span style=\"color: #333399;\">}<\/span><br \/><span style=\"color: #333399;\">else <\/span><br \/><span style=\"color: #333399;\">{<\/span><br \/><span style=\"color: #333399;\">printf(&#8220;Passed with third division with %f percent&#8221;,av);<\/span><br \/><span style=\"color: #333399;\">}<\/span><\/p>\n<p><span style=\"color: #333399;\">}<\/span><br \/><span style=\"color: #333399;\">else <\/span><br \/><span style=\"color: #333399;\">printf(&#8220;Fail&#8221;);<\/span><\/p>\n<p>}<br \/><span style=\"color: #333399;\">else<\/span><br \/><span style=\"color: #333399;\">printf(&#8220;Fail&#8221;);<\/span><br \/><span style=\"color: #333399;\">}<\/span><\/p>\n<p><span style=\"color: #333399;\">OUTPUT<\/span><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-175\" src=\"\/wp-content\/uploads\/2020\/07\/2061-300x155.png\" alt=\"\" width=\"300\" height=\"155\" srcset=\"\/wp-content\/uploads\/2020\/07\/2061-300x155.png 300w, \/wp-content\/uploads\/2020\/07\/2061.png 478w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/> <img loading=\"lazy\" class=\"alignnone size-medium wp-image-176\" src=\"\/wp-content\/uploads\/2020\/07\/20611-300x184.png\" alt=\"\" width=\"300\" height=\"184\" srcset=\"\/wp-content\/uploads\/2020\/07\/20611-300x184.png 300w, \/wp-content\/uploads\/2020\/07\/20611.png 447w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\/*Q.1(b).write a program that reads different names and addressses into computer and rearrange the names into alphabetical order using the structure variables.*\/<br \/><span style=\"color: #000080;\">#include&lt;stdio.h&gt;<\/span><br \/><span style=\"color: #000080;\">#include&lt;string.h&gt;<\/span><br \/><span style=\"color: #000080;\">#define Num 5<\/span><\/p>\n<p><span style=\"color: #000080;\">struct info<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">char name[25];<\/span><br \/><span style=\"color: #000080;\">char address[50];<\/span><br \/><span style=\"color: #000080;\">}s[Num], temp;<\/span><\/p>\n<p><span style=\"color: #000080;\">void main()<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">int i, j;<\/span><br \/><span style=\"color: #000080;\">for(i=0; i&lt;Num; i++)<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">printf(&#8220;\\nEnter name: &#8220;);<\/span><br \/><span style=\"color: #000080;\">scanf(&#8220;%s&#8221;, s[i].name);<\/span><\/p>\n<p><span style=\"color: #000080;\">printf(&#8220;Enter address: &#8220;);<\/span><br \/><span style=\"color: #000080;\">scanf(&#8220;%s&#8221;, s[i].address);<\/span><\/p>\n<p><span style=\"color: #000080;\">}<\/span><br \/><span style=\"color: #000080;\">printf(&#8220;\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;\\n&#8221;);<\/span><br \/><span style=\"color: #000080;\">printf(&#8220;Name\\tAddress\\n&#8221;);<\/span><br \/><span style=\"color: #000080;\">for(i=0; i&lt;Num; i++)<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">for(j=i+1; j&lt;Num; j++)<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">if(strcmp(s[j].name, s[i].name)&lt;0)<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">temp = s[j];<\/span><br \/><span style=\"color: #000080;\">s[j] = s[i];<\/span><br \/><span style=\"color: #000080;\">s[i] = temp;<\/span><br \/><span style=\"color: #000080;\">}<\/span><br \/><span style=\"color: #000080;\">}<\/span><br \/><span style=\"color: #000080;\">printf(&#8220;%s\\t%s\\n&#8221;, s[i].name, s[i].address);<\/span><br \/><span style=\"color: #000080;\">}<\/span><\/p>\n<p><span style=\"color: #000080;\">printf(&#8220;\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;\\n&#8221;);<\/span><br \/><span style=\"color: #000080;\">}<\/span><\/p>\n<p><strong>OUTPUT<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-185\" src=\"\/wp-content\/uploads\/2020\/07\/hseb2-300x300.png\" alt=\"\" width=\"300\" height=\"300\" srcset=\"\/wp-content\/uploads\/2020\/07\/hseb2-300x300.png 300w, \/wp-content\/uploads\/2020\/07\/hseb2-150x150.png 150w, \/wp-content\/uploads\/2020\/07\/hseb2-70x70.png 70w, \/wp-content\/uploads\/2020\/07\/hseb2-246x246.png 246w, \/wp-content\/uploads\/2020\/07\/hseb2-276x276.png 276w, \/wp-content\/uploads\/2020\/07\/hseb2-125x125.png 125w, \/wp-content\/uploads\/2020\/07\/hseb2.png 459w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\/\/Q.2(a)write a program using c language to read the age of 100 persons and count the number of persons in the age group between 50 to 60. Use &#8216;for&#8217; and &#8216;continue&#8217; statements.<br \/><span style=\"color: #000080;\">#include&lt;stdio.h&gt;<\/span><br \/><span style=\"color: #000080;\">#define max 100<\/span><br \/><span style=\"color: #000080;\">void main()<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">int age[max],i,count=0;<\/span><br \/><span style=\"color: #000080;\">printf(&#8220;enter the age of 100 students\\n&#8221;);<\/span><br \/><span style=\"color: #000080;\">for(i=0;i&lt;max;i++)<\/span><br \/><span style=\"color: #000080;\">{<\/span><br \/><span style=\"color: #000080;\">scanf(&#8220;%d&#8221;,&amp;age[i]);<\/span><br \/><span style=\"color: #000080;\">if(age[i]&lt;50 || age[i]&gt;60)<\/span><br \/><br \/><span style=\"color: #000080;\">continue;<\/span><br \/><br \/><span style=\"color: #000080;\">else<\/span><br \/><span style=\"color: #000080;\">count++;<\/span><br \/><br \/><span style=\"color: #000080;\">}<\/span><br \/><br \/><span style=\"color: #000080;\">printf(&#8220;the number of person in the age group 50 and 60 is %d:&#8221;,count); <\/span><br \/><span style=\"color: #000080;\">}<\/span><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/HSEB or NEB\/\/year 2061(2004)\/*Q.1(a).The marks obtained by studen in 7 different subjects are entered through the keyboard. The student gets &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,8],"tags":[],"_links":{"self":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/174"}],"collection":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=174"}],"version-history":[{"count":6,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/174\/revisions"}],"predecessor-version":[{"id":189,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=\/wp\/v2\/posts\/174\/revisions\/189"}],"wp:attachment":[{"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=174"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/suryaprakash.com.np\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}