Computer Science SLO Based Key Point Notes

👉👉👉 Computer Science 12th Class Notes (Main Page)

************************************

Unit 3: Object-Oriented Programming in C++


3.4.3 Order of Precedence of Operator 

  • The order in which different types of operators in an expression are evaluated is known as operator precedence.
  • It is also called the hierarchy of operators.
  • If an expression contains different types of operators, the operator with higher precedence is evaluated before the operator with lower precedence.


Example No. 1.


#include <iostream.h>
#include <conio.h>
void main()
{
        int num1, num2, total;
        num1= 13;
        num2 = 20;
        total = num1 + num2;
        cout<<”The total of “<<num1<<” and “
        <<num2<<” is “<<total<<endl;
        getch();
}


Example No. 2.


#include <iostream.h>
#include <conio.h>
void main()
{
        int n;
        n=10;
        cout<<”The initial value of n is “<<n<<endl;
        n++;
        cout<<”The value of n is now “<<n<<endl;
        n++; n++;
        cout<<”The value of n is now “<<n<<endl;
        n--;
        cout<<”The value of n is now “<<n<<endl;
        getch();
}


👇👇👇👇👇👇👇👇👇👇👇👇


************************************
👉👉👉 Computer Science 12th Class Notes (Main Page)

************************************



(National Book Foundation - As Federal Textbook Board, Islamabad 
Based on National Curriculum Pakistan 2026-2027 and Onward prescribed by Federal Board of Intermediate and Secondary Education, Islamabad, and All Pakistan Boards) 

{Contact WhatsApp # +923339719149 for Class-XII Computer Science Complete SLO-Based Key Points notes in pdf format as well as in PowerPoint Presentation for preparing/delivering the Lectures}

Note:  Write me in the comments box below for any query and also Share this information with your class-fellows and friends.