Skip to main content

Posts

Showing posts from August, 2018

Operator Precedence Rules and Associativity in C++

The solution to the problem in any program is written as expressions (like sum = n1 + n2, avg = (n1 + n2 + n3) / 3 etc.). These expressions are composed of operators and operands (variable / constant). These expressions can be simple expressions of with single operator or a complex expression with more than one operator. When an expression is made up of more than one operators then it is necessary to determine which operation will be in place before or in what order all operations will take place. For this, operator precedence rules and associativity are used in C-language. The precedence and associativity of some of the key operators in the C++ language are as follows:
किसी भी प्रोग्राम में समस्या के हल को expressions(जैसे— sum=n1+n2, avg=(n1+n2+n3)/3 etc.) के रूप में लिखा जाता है। इन expressions का निर्माण operators व operands (variable/constant) से मिलकर होता है। ये expression एक operator वाले साधारण expression हो सकते है या एक से अधिक operator वाले जटिल expression भी हो सकते है। जब…

Operator Precedence Rules and Associativity in C

The solution to the problem in any program is written as expressions (like sum = n1 + n2, avg = (n1 + n2 + n3) / 3 etc.). These expressions are composed of operators and operands (variable / constant). These expressions can be simple expressions of with single operator or a complex expression with more than one operator. When an expression is made up of more than one operators then it is necessary to determine which operation will be in place before or in what order all operations will take place. For this, operator precedence rules and associativity are used in C-language. The precedence and associativity of some of the key operators in the C-language are as follows:
किसी भी प्रोग्राम में समस्या के हल को expressions(जैसे— sum=n1+n2, avg=(n1+n2+n3)/3 etc.) के रूप में लिखा जाता है। इन expressions का निर्माण operators व operands (variable/constant) से मिलकर होता है। ये expression एक operator वाले साधारण expression हो सकते है या एक से अधिक operator वाले जटिल expression भी हो सकते है। जब क…

Control Statements in C++

Control statements or programming constructs are those statements that determine order in which other statements of program are to be executed by computer. Generally execution of statements within program happens sequentially in order they are written. This execution starts from first statement of main and executing all statements stops at last statement of main. But in many cases we need not to execute all statements within main and we have to execute some statements or skip some statements or execute some statements more than once. In such cases we have to use control statements. There are following three types of control statements available in C++ Language

Control statements या programming constructs उन statements को कहा जाता है जो यह निर्धारित करते है कि प्रोग्राम के अन्य statements किस क्रम में कम्प्यूटर के द्वारा execute होंगे। सामान्यतः प्रोग्राम में statements का execution उसी क्रम में होता है जिस क्रम में वे लिखे होते है। यह execution main के पहले statement से start होता है…

Operators in C++

Symbolsthat are used to perform operation between variables are called operators. Each program has to perform many operations on its variables to solve a problem. These all operations are done by operators. C++ Language has following types of operators to handle these operations:

Variables के मध्य operation करने के लिए प्रयोग किए जाने वाले symbol operator कहलाते है। प्रत्येक प्रोग्राम को समस्या को हल करने के लिए अपने variables पर बहुत सारे operations करने होते है। ये सारे operation operators के द्वारा किए जाते है। इन सभी operations को handle करने के लिए C++ Language में निम्नलिखित टाईप के operators होते है— 
1. Arithmetic Operators (+ - * / %) 2. Relational Operators (< > <= >= == !=) 3. Logical Operators (&& || !) 4. Assignment Operators (= += -= *= /= %=) 5. Conditional Operator (?:) 6. Increment & Decrement Operators (++ --) 7. Bitwise Operators (& | ^ ~ << >>)  8. Special Operators ( ( ) [ ] , . -> (type) sizeof( ) )
1. Arithmetic Operators
Arithmet…

Operators in C

Symbolsthat are used to perform operation between variables are called operators. Each program has to perform many operations on its variables to solve a problem. These all operations are done by operators. C-Language has following types of operators to handle these operations:

Variables के मध्य operation करने के लिए प्रयोग किए जाने वाले symbol operator कहलाते है। प्रत्येक प्रोग्राम को समस्या को हल करने के लिए अपने variables पर बहुत सारे operations करने होते है। ये सारे operation operators के द्वारा किए जाते है। इन सभी operations को handle करने के लिए C-Language में निम्नलिखित टाईप के operators होते है— 
1. Arithmetic Operators (+ - * / %) 2. Relational Operators (< > <= >= == !=) 3. Logical Operators (&& || !) 4. Assignment Operators (= += -= *= /= %=) 5. Conditional Operator (?:) 6. Increment & Decrement Operators (++ --) 7. Bitwise Operators (& | ^ ~ << >>)  8. Special Operators ( ( ) [ ] , . -> (type) sizeof( ) )
1. Arithmetic Operators
Arithmetic o…