What is a Computer language?

Arnab Chakraborty
Updated on 04-Oct-2019 11:09:46

12K+ Views

To communicate with the computers, we need some languages. These are computer languages.There are mainly three different languages with the help of which we can develop computer programs. And they are –Machine Level languageAssembly Level Language andHigh Level LanguageMachine Level LanguageComputer can understand only the language of Digital Electronics. Digital Electronics deals with presence and absence of voltages. Within the computer there are two logics can play their role. These logics are –Positive Logic – Here presence of voltage will be denoted by 1 and absence of voltage will be denoted by 0Negative Logic – Here presence of voltage will be ... Read More

Biggest Reuleaux Triangle inscribed within a Square inscribed in an equilateral triangle in C?

sudhir sharma
Updated on 04-Oct-2019 11:05:58

44 Views

A Reuleaux triangle is a shape formed from the intersection of three circular disks, each having its center on the boundary of the other two. Its boundary is a curve of constant width, the simplest and best known such curve other than the circle itself. Constant width means that the separation of every two parallel supporting lines is the same, independent of their orientation. Because all its diameters are the same.The boundary of a Reuleaux triangle is a constant width curve based on an equilateral triangle. All points on a side are equidistant from the opposite vertex.To construct a Reuleaux ... Read More

MySQL query for grouping and summing the values based on specific records

AmitDiwan
Updated on 04-Oct-2019 08:42:26

56 Views

Use GROUP BY to group records, whereas SUM() function is used to add. Let us first create a table −mysql> create table DemoTable (    Name varchar(40),    Subject varchar(40),    Marks int ); Query OK, 0 rows affected (2.89 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 'MySQL', 76); Query OK, 1 row affected (0.32 sec) mysql> insert into DemoTable values('Sam', 'MongoDB', 86); Query OK, 1 row affected (0.39 sec) mysql> insert into DemoTable values('Mike', 'MySQL', 98); Query OK, 1 row affected (0.46 sec) mysql> insert into DemoTable values('David', 'Java', 93); Query OK, ... Read More

Update the table by calculating the sum and display the result as last column value

AmitDiwan
Updated on 04-Oct-2019 08:39:35

488 Views

Use a variable to store SUM(total) and update it with the UPDATE command. Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    Value int ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Value) values(70); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable(Value) values(100); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable(Value) values(150); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable(Value) values(250); Query OK, 1 row affected (0.14 sec) mysql> ... Read More

How can I return a record from a table nearest to a user-defined variables value in MySQL?

AmitDiwan
Updated on 04-Oct-2019 08:36:23

122 Views

Let us first create a table −mysql> create table DemoTable (    CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ProductAmount int ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ProductAmount) values(5000); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(ProductAmount) values(6000); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable(ProductAmount) values(7000); Query OK, 1 row affected (0.26 sec)Display all records from the table using select statement −mysql> select *from DemoTable;This will produce the following output −+------------+---------------+ | CustomerId | ProductAmount | +------------+---------------+ | ... Read More

Biggest Reuleaux Triangle inscribed within a square inscribed in a semicircle in C?

sudhir sharma
Updated on 04-Oct-2019 08:33:33

64 Views

A Reuleaux triangle is a shape formed by using intersection of three circle, in such a way that each having its center on the boundary of the other two circles. Its boundary is a curve of constant width, the simplest and best known such curve other than the circle itself. Constant width means that the separation of every two parallel supporting lines is the same, independent of their orientation. Because all its diameters are the same.The boundary of a Reuleaux triangle is a constant width curve based on an equilateral triangle. All points on a side are equidistant from the ... Read More

How to use the submit button in HTML forms?

mkotla
Updated on 04-Oct-2019 08:31:47

4K+ Views

Submit button automatically submits a form on click. Using HTML forms, you can easily take user input. The tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc.Let’s learn about how to use the submit button in HTML forms. It is also created using HTML tag but type attribute is set to button.You can try to run the following code to use submit button to submit and reset a form. Under the action, attribute add the file, where you want to reach after ... Read More

How does COALESCE order results with NULL and NON-NULL values?

AmitDiwan
Updated on 04-Oct-2019 08:31:21

558 Views

The COALESCE() finds the NON-NULL value first If it finds the same in the beginning, then it returns, otherwise moves ahead to check NON-NULL value.Let us first create a table −mysql> create table DemoTable (    Number1 int,    Number2 int ); Query OK, 0 rows affected (5.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 200); Query OK, 1 row affected (0.40 sec) mysql> insert into DemoTable values(NULL, 50); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(10, NULL); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable ... Read More

Betrothed numbers in C?

sudhir sharma
Updated on 04-Oct-2019 08:30:08

1K+ Views

Betrothed numbers are pair of two numbers in a way that the sum of their divisors when added by is equal to another number.For example (a,  b) are a pair of betrothed numbers if s(a) = b + 1 and s(b) = a + 1, where s(b) is the aliquot sum of b: an equivalent condition is that σ(a) = σ(b) = a + b + 1, where σ denotes the sum-of-divisors function.The first few pairs of betrothed numbers are: (48,  75), (140,  195), (1050,  1925), (1575,  1648), (2024,  2295), (5775,  6128).All known pairs of betrothed numbers have opposite parity. Any pair of the same parity must exceed 1010.AlgorithmStep 1: Find the sum of all divisors for both numbers. Step 2: Finally ... Read More

MySQL query to find latest 3 dates in a table and the resultant dates shouldn’t be duplicate

AmitDiwan
Updated on 04-Oct-2019 08:28:52

340 Views

To find the latest dates, order the date records with ORDER BY DESC. Since we want only 3 dates, use LIMIT 3.Let us first create a table −mysql> create table DemoTable (    AdmissionDate date ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-09-04'); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable values('2019-08-10'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('2019-09-21'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('2019-09-18'); Query OK, 1 row affected (0.17 sec) mysql> ... Read More

Advertisements