Showing posts with label What is Operator in programming Language. Show all posts
Showing posts with label What is Operator in programming Language. Show all posts

Sunday, 16 October 2022

Special Operator in c++, C Language |SizeOf Operator in C, C++ |What is Operator in C, C++ |Type of Operators in C Language, C++ |Operators in Programming Language |What is ope in programming Language

   - : sizeof() operator :-

     Operators are those symbols which are used between operands to perform Mathematical and Logical operations.

    sizeOf() is a keyword which is used to determine the size of the variable or datatype in bytes.

Syntax:-

                   sizeof (DataType) 

_____________________________________________________________

A program for SizeOf() operator


#include<iostream>

using namespace std ;

int main () {

       int a;

      float b;

      char c;

      double d;


cout<<"size of integer = " <<sizeof(a) <<endl;

cout <<"size of float = " <<sizeof(b) <<endl;

cout<<"size of char = " <<sizeof(c) <<endl ;

cout<<"size of double = " <<sizeof(d)  <<endl;

return 0 ;

}

_____________________________________________________________


Output :-

          size of integer = 4

          size of float = 4

         size of char = 1

         size of double =  8

_____________________________________________________________

must read other operators :-


What is Operator in Programming Language 

What is Arithmetic Operator in Programming Language 

What is Relational Operator in C, C++ programming languages 

What is Logical Operators in C, C++ Programming Language (English Explanation) 

What is Logical Operator in C, C++ Language (Hindi Explanation) 

What is Bitwise Operator in C, C++

increment Decrement Operators in Programming Language 

Conditional Operators in Programming Language C++

Assignment Operators in Programming Language C++ 













Saturday, 8 October 2022

Assignment Operators in Programming Language |Assignment Operators in c++, C Language |What is Assignment Operator in C language, C++ |What is Assignment operator in Computer Language |Types of Operators in Programming Language |What is Operator in C language, C++

 - : Assignment Operators :-

    Operators are those symbols which are used between operands to perform Mathematical and Logical operations.

    Assignment Operators are used to assign the values to the variable. Assignment Operator Includes Following Symbols giver below -

  • (+=)
  • (-=) 
  • (*=)
  • ( /=)
  • (%=)
  • (=) 
Keypoint 1:- 
        Data type of variable should be same as the value to be assigned.
For Example, 
             X += 10;
here X containing an integer type data, so it is mandatory to specify the Data type of the variable. so now it will be written as - 
      int X += 10;
 
Keypoint 2:- 
          In the assignment operator, variable performs operation on current value and then the result assigned to that variable which becomes original value of the variable. 
For Example, 
        suppose X = 10;
              now we want to perform X += 5 using (+=) operator. 
So here meaning of X+=5 is that 
                  X = X+5;
                 X = 10 + 5;            //we took X = 10 for example 
                 X = 15;                 //now further operation we be performed by                                                      assuming the value of X as 15. 

_____________________________________________________________
A program to understand Assignment Operators 

#include<iostream>
using namespace std ;
int main(){
       int X = 10;
       cout<<"now value of X after performing (X+=5) Will be = " <<X+=5 <<endl ;                    //X = X+5,
       cout<<"now value of X after performing (X-=3) Will be = " <<X-=3  <<endl ;                    //X = X-3,
       cout<<"now value of X after performing (X*=4) Will be = " <<X*=4 <<endl ;                   //X = X*4,

       cout<<"now value of X after performing (X/=2) Will be = " <<X/=2 <<endl ;                    //X = X/2,
       cout<<"now value of X after performing (X%=8) Will be = " <<X%=8 <<endl ;                   //X = X%8,

      return 0 ;
_____________________________________________________________
Output :-
now value of X after performing (X+=5) Will be = 15
now value of X after performing (X-=3) Will be = 12
now value of X after performing (X*=4) Will be = 48
now value of X after performing (X/=2) Will be = 24
now value of X after performing (X%=8) Will be = 0

_____________________________________________________________