Count Elements Less Than 0A in 8085

George John
Updated on 30-Jul-2019 22:30:26

547 Views

In this section we will count elements which are lesser than 0AH using 8085.problem StatementThere is an array of some elements. Write 8085 Assembly language program to count number of elements that are lesser than 0AH.DiscussionThe array is placed at location F051H onwards. The F050 is holding the size of the array. The logic is simple. At first we will take the array size into the B register. The C register will count number of elements less than 0AH. We will take numbers one by one from memory, then compare it with 0A. if the CY flag is set it ... Read More

Query MongoDB with $lte and $in Operators

Smita Kapse
Updated on 30-Jul-2019 22:30:26

197 Views

Let us first create a collection with documents −> db.queryMongoValueDemo.insertOne(    {       _id:101,       "ScoreDetails":[{Score:80}, {Score:45}, {Score:25}, {Score:70}]    } ); { "acknowledged" : true, "insertedId" : 101 } > db.queryMongoValueDemo.insertOne(    {       _id:102,       "ScoreDetails":[{Score:80}, {Score:24}, {Score:34}]    } ); { "acknowledged" : true, "insertedId" : 102 } > db.queryMongoValueDemo.insertOne(    {       _id:103,       "ScoreDetails":[{Score:99}, {Score:95}]    }   ); { "acknowledged" : true, "insertedId" : 103 }Display all documents from a collection with the help of find() method −> db.queryMongoValueDemo.find().pretty();This will produce the ... Read More

Average of Odd Numbers Till a Given Odd Number

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

3K+ Views

The average of odd numbers till a given odd number is a simple concept. You just need to find odd numbers till that number then take their sum and divide by the number.If average of odd number till n is to be found. Then we will find odd numbers from 1 to n add then divide it by the number of odd number.ExampleAverage of odd number till 9 is 5 i.e.1 + 3 + 5 + 7 + 9 = 25 => 25/5 = 5There are two methods for calculating the average of odd number till n which is an ... Read More

HTML DOM Input Week Required Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

119 Views

The HTML DOM Input Week required property determines whether Input Week is compulsory to set or not.SyntaxFollowing is the syntax −Returning boolean value - true/falseinputWeekObject.requiredSetting required to booleanValueinputWeekObject.required = booleanValueBoolean ValuesHere, “booleanValue” can be the following −booleanValueDetailstrueIt is compulsory to set the week field to submit form.falseIt is the default value and to set week field is not compulsory.ExampleLet us see an example for Input Week required property − Live Demo Input Week required    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {   ... Read More

MySQL Query to Get Result by Month and Year Based on Condition

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

253 Views

You need to use OR condition along with WHERE clause. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    MonthNumber int,    YearNumber int    ); Query OK, 0 rows affected (0.22 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(MonthNumber, YearNumber) values(11, 2018); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable(MonthNumber, YearNumber) values(3, 2019); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable(MonthNumber, YearNumber) values(12, 2018); Query OK, 1 row affected (0.08 sec) mysql> insert ... Read More

Create Horizontal Slider with Custom Min, Max and Initial Value in Java

George John
Updated on 30-Jul-2019 22:30:26

271 Views

While creating horizontal slider, we can set custom values as well. Let us take three integer variable and set the int values for min, max as well as the initial value of the slider −int val = 75; int min = 0; int max = 100;Set it to the slider while creating a new slider. Here, we have set the constant to be HORIZONTAL, since we are creating a horizontal slider −JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, val);The following is an example to create a horizontal slider with custom min, max and initial value −Examplepackage my; import java.awt.Color; import ... Read More

Count Number of Elements in an Array with MongoDB

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

1K+ Views

To count number of elements in an array, use the aggregate framework. Let us first create a collection with documents −>db.countNumberOfElementsDemo.insertOne({"UserMessage":["Hi", "Hello", "Bye", "Awesome"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cef8ec2ef71edecf6a1f6a1") }Display all documents from a collection with the help of find() method −> db.countNumberOfElementsDemo.find().pretty();This will produce the following output −{    "_id" : ObjectId("5cef8ec2ef71edecf6a1f6a1"),    "UserMessage" : [       "Hi",       "Hello",       "Bye",       "Awesome"    ] }Following is the query to count number of elements in an array −> db.countNumberOfElementsDemo.aggregate({$project: { NumberOfElements: { $size:"$UserMessage" }}})This will produce ... Read More

HTML DOM Object Name Property

Chandu yadav
Updated on 30-Jul-2019 22:30:26

167 Views

The HTML DOM Object name property sets or returns the value of the name attribute. However, the name attribute only sets the name.Following is the syntax to set the object name property −obj.nameFollowing is the syntax to return the object name property −obj.name = nameLet us now see an example to implement the DOM Object name property −Example Live Demo Change the object name function display() { document.getElementById("obj1").name = "obj2"; document.getElementById("demo").innerHTML = "Name updated to obj2"; } OutputNow, click the button to update the object name −

Average of Even Numbers Till a Given Even Number

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

3K+ Views

To find the average of even numbers till a given even number, we will add all the even number till the given number and t count the number of even numbers. Then divide the sum by the number of even numbers.ExampleAverage of even numbers till 10 is 6 i.e.2 + 4 + 6 + 8 + 10 = 30 => 30/ 5 = 6There are two methods for calculating the average of even number till n which is an even number.Using LoopsUsing FormulaProgram to find the average of even number till n using loopsTo calculate the average of even numbers ... Read More

HTML DOM Input Week Step Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

136 Views

The HTML DOM Input Week step property determines the legal intervals for only weeks.SyntaxFollowing is the syntax −Returning number valueinputWeekObject.stepSetting step attribute to a number valueinputWeekObject.step = numberParametersParameter number values −weeksall values are legal values as long as it is a positive integerExampleLet us see an example for Input Week step property − Live Demo Input Week step    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: ... Read More

Advertisements