Ankith Reddy has Published 996 Articles

8086 program to search a number in a string

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

3K+ Views

In this program we will see how to find a number n from a string (an array of numbers).Problem StatementWrite 8086 Assembly language program to find a number in a string (an array of numbers). The numbers are stored at memory offset 600 onwards.DiscussionIn this program we are taking only ... Read More

How to convert date YYYYMMDD to YY-MM-DD in MySQL query?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

2K+ Views

To convert date YYYYMMDD to YY-MM-DD in MySQL, use the below syntax −select date_format(str_to_date(yourColumnName, '%Y%m%d'), '%Y-%m-%d') from yourTableName;Let us first create a table −mysql> create table DemoTable (    ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ClientProjectDeadline varchar(200) ); Query OK, 0 rows affected (0.57 sec)Insert some records in ... Read More

Precedence of postfix ++ and prefix ++ in C/C++

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

2K+ Views

Here we will see the precedence of postfix++ and prefix++ in C or C++. The precedence of prefix ++ or -- has higher priority than dereference operator ‘*’ and postfix ++ or -- has priority higher than both prefix ++ and dereference operator ‘*’.When ptr is a pointer, then *ptr++ ... Read More

Resolve the error Column count doesn’t match value count in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

863 Views

This type of error occurs when number of columns does not match whenever you are inserting records in the destination table. For a demo example, let us create a tablemysql> create table errorDemo    -> (    -> User_Id int NOT NULL AUTO_INCREMENT,    -> User_Name varchar(20),    -> PRIMARY ... Read More

What does /* in MySQL means?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

484 Views

This is a type of comment. The /* is the beginning of a comment and */ is the end of comment.Let us implement and display how to create a commentmysql> /* This is the first MySQL Program */MySQL will ignore the above comment.Let us see an example. Here, we have ... Read More

8085 Program to perform selection sort in descending order

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

762 Views

Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to sort a sequence of numbers in reverse order using selection sort.Problem Statement:Write 8085 Assembly language program to sort a given sequence using selection sort in descending order. The numbers are stored at ... Read More

Printing Heart Pattern in C

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

9K+ Views

In this program we will see how to print heart shaped pattern in C. The heart shape pattern will be look like thisNow if we analyze this pattern, we can find different section in this pattern. The base of the heart is an inverted triangle; the upper portion has two ... Read More

MySQL SELECT to add a new column to a query and give it a value?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

13K+ Views

To add column to MySQL query and give it a value, use the below syntax −select yourColumnName1, yourColumnName2, .....N ,yourValue AS anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    FirstName varchar(20) ); Query OK, 0 rows ... Read More

When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

420 Views

const_castcan be used to remove or add const to a variable. This can be useful if it is necessary to add/remove constness from a variable.static_castThis is used for the normal/ordinary type conversion. This is also the cast responsible for implicit type coercion and can also be called explicitly. You should ... Read More

Get MySQL maximum value from 3 different columns?

Ankith Reddy

Ankith Reddy

Updated on 30-Jul-2019 22:30:25

7K+ Views

To get the maximum value from three different columns, use the GREATEST() function.The syntax is as followsSELECT GREATEST(yourColumnName1, yourColumnName2, yourColumnName3) AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table MaxOfThreeColumnsDemo    -> (    -> ... Read More

Advertisements