EXPRESSIONS IN C - TGN

Latest

Welcome to Technicalgurunow! Your No. 1 source for all networking , earning and programming tutorials. We're dedicated to providing you the best of knowledgeable information with a focus on dependability. We hope you enjoy our blog.

Saturday, December 14, 2019

EXPRESSIONS IN C

EXPRESSIONS IN C

  • ARITHMETIC EXPRESSIONS :
    • An arithmetic expressions is a combinations of variables , constants , and operators arranged as per the syntax of the language. C can handle any complex mathematical expressions. Some of the examples of C expressions are shown in figure .

in that post we learn about what is the Expressions in c language.













  • EVALUATION OF EXPRESSIONS :
    • Expressions are evaluated using an assignment statement of the form :
              variable = expressions ;

                X = A * B - C ;
                Y = B / C * A;


#include <stdio.h>

int main()
{
float x, y, a, b;
a = 10;
b = 20;

x = (a * b) - (10 / b) ; // expression 1
y = b + (a * 30) / a ; // epression 2

printf(" x = %f /n",x);
printf(" y = %f ",y);

return 0;
}

output :  x = 199.500000
              y = 50.000000

Expressions nothing but mathematical calculations, variables , operators and constants.(+, - , / , * , %) .


No comments:

Post a Comment

If you have any query, please let me know

Followers