Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 2566 of 2650
2K+ Views
In python there are two number data types: integers and floats. In general integers do not have any decimal points and base value is 10 (i.e., Decimal). Whereas floats have decimal points. Python provides some built−in methods to convert floats to integers. In this article we will discuss some of them. Using the int() function The int() function converts the floating point numbers to integers, by removing the decimals and remains only the integer part. Also the int() function does not round the float values like 49.8 up to 50. Example In the example the data after the decimal ... Read More
38K+ Views
To convert an integer to a character in Python, we can use the chr() method. The chr() is a Python built−in method that returns a character from an integer. The method takes an integer value and returns a unicode character corresponding to that integer. Syntax char(number) Parameter The method takes a single integer between the range of 0 to 1, 114, 111. Return Value A unicode character of the corresponding integer argument. And it will raies a ValueError if we pass an out of range value (i, e. range(0x110000)). Also it will raise TypeError − for a non−integer argument. ... Read More
520 Views
volatile means two things − The value of the variable may change without any code of yours changing it. Therefore whenever the compiler reads the value of the variable, it may not assume that it is the same as the last time it was read, or that it is the same as the last value stored, but it must be read again. The act of storing a value to a volatile variable is a "side effect" which can be observed from the outside, so the compiler is not allowed to remove the act of storing a value; for example, ... Read More
5K+ Views
A Python list is a built-in, mutable datatype that stores multiple items or elements, separated by commas, within square brackets [ ]. The index of a list in Python starts from 0 up to length-1. We can retrieve/access elements at a particular index as follows - list_name[index] The given task is to write a Python program that prints the first character of each element in a list. But, before that, let's see some example scenarios: Scenario 1 For example, if our list contains string values, the output should be the first character of each string. Input: list = ... Read More
3K+ Views
In a statically typed language such as C++, type specifiers are keywords that are used to define the type of data that given variables will hold. There are two types of type specifiers: built-in and user-defined type specifiers. Built-in Type SpecifiersThe built-in type specifiers are the basic and predefined data types provided by C++, such as int, float, char, signed, unsigned, short, long, etc. int myNumber = 42; In this given statement, the "int" is a type specifier, which states that the variable "myNumber" can only store integer values or numeric data types. There exist a lot of built-in type specifiers in C++ ... Read More
2K+ Views
A type qualifier is a keyword in C++ that is applied to a variable, function, pointer, or parameter to add an extra feature or quality to it. For example, const int is a qualified type representing a constant integer, while int is an unqualified type, which is simply just an integer. Type qualifiers are a way of expressing additional information about a value through the type system, which ensures correctness in the use of the data. 1. The const Qualifier This is used to define a variable (or object) as constant, which means its value cannot be changed or modified ... Read More
889 Views
In C++, character literals are the constant values, which are assigned to variables of the character data type. These values are represented by a character enclosed within single quotation marks. There are mainly five types of character literals: Narrow-character literals Wide-character literals. UTF-8 character literals UTF-16 character literals UTF-32 character literals Narrow-character Literals These character literals are of type char, which represents single-byte character. It stores characters from the ASCII table, which includes values ranging from 0 to ... Read More
496 Views
Boolean Literals In C++, Boolean literals are the values, which are assigned to variables of the Boolean data type. A Boolean literal represents two values: true or false, which are internally represented as 1 and 0 respectively. A Boolean literal occupies 1 byte (8 bits) of memory and is used for conditions, flags and logical checks. Declaring Boolean Variables You can declare the boolean variables and assign the boolean literals to them by the given following. In this variable1 and variable2 is assigned with boolean literals true and false respectively in C++. bool variable1 = true; bool variable2 = false; ... Read More

