GET EDUCATE

Contents
Basics of C Programming

⯈Basic C Programs

Convert mathematical expression to C expression

In this section we will discuss how do we convert a given mathematical expression to a C equivalent statement.

Let us understand this with the help of some examples.

You may also refer to the video posted at the end of this page.

Examples

math expression

In C programming language, no operator is assumed. We cannot write a.b, we need to write it as a *b.

There is no whole division, we need to put the complete denominator in brackets for whole division. 

No mathematical operators like √ are allowed in C programming language. For these we use some built-in mathematical functions. (discussed later)

Therefore, the C equivalent statement is,

Z = ( (y+4) * y * y ) / ( (y+8) * x*x*x / 4 ) ;

math expression

C Equivalent statement,

Let 

N = 17. * m * ( 4 * a + 3) – (3 * m + 2);

D = 1/y * ( x+ 2);

A = N / D;

Scroll to Top