To evaluate any expression, we shouldknow the hierarchy or precedence of all types of operators. Sofarwe have discussed various types of operators. Systematic Approach to Data Structures using C 1.22. The syntax is shown below: sizeof (operand) For example, sizeof( char) sizeof(int) sizeof(float) II Output b = 25 1.7.11.2 sizeof operator This operator is used to fmd the number of bytes occupied by a variable or a constan in the computer memory. Example 1.7.11.1: Consider the set of statements shown below: temp = a a=b b = temp These three different statements can be written as a single statement using cornm operator as shown below: temp = a, a = b, b = temp Įxample 1.7.11.2: Consider the statements shown below: a = 5 + 5, 6 * 5 II Output a = 30 b = 3, 25. It ill the least precedence during evaluation of an expression. The statements executed one by one from left to right and hence it is Ieft associative operator. Th compact statements can be written using comma operator. The various symbols used and the associated meanings are shown in the table below: Associativitv Precedence Operator Description Bit-wise Negateġ.7.11 Special operators Let us discuss some special operators that are supported in C language.ġ.7.1 J.l Comma operator (, operator) ow, let us see "What is a comma operator and what is its advantage?" Definition: The comma operator represented as a comma (, ) accepts two operant and it is used to combine two or more statements into a single statement. The operators that are used tomanipulatethe bits are called bit wise operators. r=:=tPurchase Book with Hologram Onlyĭata structures (with C) aoot b ) ? a : b big = 20 Output BIg - 2.0ġ.7.10Bitwise operators In thissection let us see "What are bitwise operators?" Definition:The data is stored in the memory in terms of binary digits i.e., O's and 1'So Sometimes, it may be necessary to manipulate these bits. * Do not buy the old book - you will not get the latest updated version.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |