Tuesday, December 23, 2008

Types of Arithmetic statement

In C language, arithmetic statements are mainly of three types, which are as follows:

1. Integer type:  In this arithmetic statement all the operands are either integer type variables or integer type constants.
Ex:  int a,b,c,d;
       j=j+5;
       a=b+5*c-d;

2. Real or float type:  In this arithmetic statement all the operands are either real type variables or real type constants.
Ex:  float a,b,c,d;

       a=b+25.53/5.5*3.325;
       a=b*c/d+124.0;

3. Mixed type:  In this type of arithmetic statement some of the operands are integer type and some are real type.
Ex: float a,b,c,d,ad;
      int e,f,g,h;
      a=b*c*d/125.0;
      ad=(e+f+g+h)/4;

{also see: How the execution of the arithmetic statement takes place}

No comments:

Post a Comment

Please give your valuable comments or queries if you fell its helpful or if you like the contents of the site. Thanks...