What is an Unsigned Char in C++

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

6K+ Views

In C++ we have seen there is character type data called char. Sometimes we have seen unsigned char also. So here we will see what is basically the unsigned char means. What are the basic differences between signed char and unsigned char?Signed char and unsigned char both are used to store single character. The variable stores the ASCII value of the characters. For an example if ‘A’ is stored, actually it will hold 65. For signed char we need not to write the signed keyword. But for unsigned, we have to mention the keyword. The syntax is like below.unsigned char ... Read More

Meaning of Background App in Android

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

7K+ Views

Foreground refers to the active apps which consume data and are currently running on the mobile. Background refers to the data used when the app is doing some activity in the background, which is not active right now.This is due to the fact that whether they are active or not, apps consume data. They may bechecking for updates or refreshing the user contentrunning ads in the backgroundsending notificationsAll these may be useful activities, but we do not want our data to deplete in the background without our permission and notice. We can restrict this background data depletion by using the ... Read More

Decimal Addition in 8085 Microprocessor

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

2K+ Views

In a digital computer, everything is represented using 0s and 1s only. For example, instruction will have a code using only 0s and 1s. Data is also represented using 0s and 1s. Data can be of different types like unsigned numbers, signed numbers, floating point numbers, binary coded decimal (BCD) numbers, etc. Thus, a series of 0s and 1s will acquire a value based on the interpretation. For decimal addition, we are having a very important and common instruction DAD. Let us discuss more on that instruction now.In spite of the fact that 8085 is an 8-bit microprocessor, but there ... Read More

Create Pair Tuple from Array in Java

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

720 Views

Use the fromArray() method to create a Pair Tuple from Array.Let us first see what we need to work with JavaTuples. To work with Pair class in JavaTuples, you need to import the following package −import org.javatuples.Pair;Note − Steps to download and run JavaTuples program. If you are using Eclipse IDE to run Pair Class in JavaTuples, then Right Click Project ->Properties ->Java Build Path ->Add External Jars and upload the downloaded JavaTuples jar file.The following is an example −Exampleimport org.javatuples.Pair; public class Demo { public static void main(String[] args) { ... Read More

Period.ofWeeks Method in Java

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

198 Views

The Period can be obtained with the given number of weeks using the ofWeeks() method in the Period class in Java. This method requires a single parameter i.e. the number of weeks and it returns the Period object with the given number of weeks.A program that demonstrates this is given as follows −Example Live Demoimport java.time.Period; public class Demo { public static void main(String[] args) { int weeks = 7; Period p = Period.ofWeeks(weeks); System.out.println("The Period is: " + p); ... Read More

Period equals Method in Java

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

163 Views

The equality of two Periods can be determined using the equals() method in the Period class in Java. This method requires a single parameter i.e. the Period object to be compared. Also it returns true if both the Period objects are equal and false otherwise.A program that demonstrates this is given as followsExample Live Demoimport java.time.Period; public class Demo {    public static void main(String[] args) {       String period1 = "P5Y7M15D";       Period p1 = Period.parse(period1);       String period2 = "P5Y7M15D";       Period p2 = Period.parse(period2);       System.out.println("The Period p1 ... Read More

Check for Crashed Table in MySQL

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

912 Views

If a table is crashed that means your ENGINE is NULL or empty. The syntax is as follows to check for crashed table.SHOW TABLE STATUS FROM yourDatabaseName;Let us implement the above syntax to check for crashed table Here, our database name is ‘test3’ with some tablesmysql> show table status from test3;The following is the output+------------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +------------------------------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | bestdateformatdemo           ... Read More

Sum Two Fields in MongoDB Using the Aggregation Framework

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

1K+ Views

Yes, it is possible using the $project operator. Let us first create a collection with documents> db.sumTwoFieldsDemo.insertOne({"FirstValue":150, "SecondValue":350}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b4bfe15e86fd1496b38cd") } > db.sumTwoFieldsDemo.insertOne({"FirstValue":450, "SecondValue":1550}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b4c1215e86fd1496b38ce") } > db.sumTwoFieldsDemo.insertOne({"FirstValue":2560, "SecondValue":2440}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b4c2715e86fd1496b38cf") }Following is the query to display all documents from a collection with the help of find() method> db.sumTwoFieldsDemo.find().pretty();This will produce the following output{    "_id" : ObjectId("5c9b4bfe15e86fd1496b38cd"),    "FirstValue" : 150,    "SecondValue" : 350 } {    "_id" : ObjectId("5c9b4c1215e86fd1496b38ce"),    "FirstValue" : 450,    "SecondValue" ... Read More

Generate Custom Random Number in Java

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

253 Views

To generate custom random number 1 or -1, you need to use nextBoolean(). At first take a loop and create a Random object on each iteration −for (int i = 0; i < 5; i++) {    Random rand = new Random(); }Now, use nextBoolean() to generate 1 on TRUE condition, ekse -1 −for (int i = 0; i < 5; i++) {    Random rand = new Random();    if (rand.nextBoolean())       System.out.println(1);    else       System.out.println(-1); }Example Live Demoimport java.util.Random; public class Demo {    public static void main(String[] args) {       for ... Read More

Benefits of C Over Other Languages

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

2K+ Views

The C programming language was developed by Dennis Ritchie during early 1970. It was developed to redesign UNIX operating system.Earlier the B language, which was used for UNIX system, it has different drawbacks. It does not support structures, and did not understand datatypes. For this reason, the C language was introduced. C has high level functionality, and detailed feature for OS programming. The UNIX kernel was developed by using C.Advantages of C languageC is medium level language. It has both, the lower level and higher level functionality. We can use C to make driver or kernel level programs as well ... Read More

Advertisements