C++


INTRODUCTION 

We Have learned about some high-level programming languages in past classes and chapters. And you know programming are the medium to gives instruction for computer by programming. computers are not so flexible as human being to understanding something.

The statement given to computer should correct. A comma can spoil the interpretation of whole statement The other thing is that computer cannot understand the statements of high-level language directly. it should be interpreted or compiled into machine language before execution. Because computer can understand its native language like before This is due to computer is a switching machine based on ON and OFF (1and 0).

C++ is also a high-level programming language that gives many strong features of programming. This language is an extension of C language. it is used to make operating system and compliers due to its nearness with low level programming features. It provides us with the use of pointer by which we can manipulate memory in an efficient way in our programs. C++ is a case sensitive language like C. It means M and m will be treated differently by compiler of language. C++ was developed by Bjarne Stroustrup in the early 1980 at ATL&T Bell laboratories. 

TOKENS USED IN C++

Smallest individual unit in a program are referred as Tokens. various kinds of token supported by C++ are given below.

KEYWORDS

Keywords are some reserved words in C++.These have predefined meaning to complier or C++. A programmer cannot use these names as name of variable or identifiers. Following table shows the C++.  keyword.

IDENTIFIERS

Programmers use the names of this category for variables, functions, etc. in a C++ program. There are some rules that we must keep in our mind while writing an identifier.

  • An identifier consists of only alphabet, digits and\or underscores. Any other special character is not allowed.
  • It must be start with a digit.
  • Uppercase and lowercase letters are considered different.
  •  It should not be reserved word.

For example, TaxRate, n, price, flow 1 are some names which can be used for identifiers.

CONSTANT

The values of constants do not change during the execution of program. These are also referred as Literals. C++ supports various types of constants are listed below.

NUMERIC CONSTANTS

Numeric constants consist of Integers constants and Real\Floating constants.

INTEGER CONSTANTS: These consist of only numbers without fractional parts. For example, 2, 14, 346 etc. These are three kinds of integers constants like Integers Decimal, Octal Integers and Hexadecimal Integer constants.

REAL\FLOATING CONSTANTS: These consist of numbers containing fractional parts. For example, 63.23, 74.1 etc.


CHARACTER CONSTANTS

Character constants of the values enclosed in double or single quotes. These are not calculatable. These types of constants may have single character or more than one character value, i.e., string value. On the basis of this, these constants are of two types:
Single Character Constants: These are enclosed in single quotes due to single character value. For example, 'G', 'r', 'i' etc.
String Character Constants:  These have groups of characters so enclosed in double quotes, For example, "Raman", "New World", "Basic Science", etc.

OPERATORS

These are symbols which are applied on variables, i.e., operands for specific purposes, Various types of operators are listed below.

Arithmetic Operators

Various mathematical calculations are done with the help of arithmetic operators like addition, subtraction, multiplication, division and modulus (or remainder) operations. Modulus operation is done with the help of integers and remaining are done with the help of integers and floating-point numbers. Following table shows the various types of arithmetic operators.


Relational Operators

Relational operators are used to compare two values. These operators always return TRUE or FALSE on the basis of condition. Following table shows the relational operators.


Logical operators

Logical operators are used to combine two or more relational conditions. The result of net combinations is evaluated as TRUE or FALSE. NOT operators are exceptional, and it can be used for one relational expression also. The following table shows the use of logical operators.

Assignment Operators 

Assignment operators is equal sign =. It is used tp assign a value to a variable. This operator takes expression on its right-hand side and places it into the variables on its left-hand side 
Example: z = 25.
The above expression stores value 25 into z variables.

Conditional Operators 

Conditional operator is the option of IF statement. It is the brief form of IF statement. This is also referred as ternary operator. It is called ternary because it uses three operands. The syntax of conditional operators is as following.
Conditional Expression? Expression1: Expression2
If the value of conditional expression is TRUE, then the Expression 1 will be evaluated otherwise Expressions2 will be evaluated.
AS4

MY NAME IS ______________ ALSO KNOWN AS AS4. AND I'M BASICALLY A STUDENT.

Post a Comment

IF YOU HAVE ANY DOUBT, PLEASE LET ME KNOW

Previous Post Next Post