Ex no:2d Evaluate the expression

AIM:

         To write a C program to evaluate

x = 8t2-t+4

y=sin 30◦

z=e3t+5 

ALGORITHM:

Step 1: Start the program.

Step 2: Read t.

Step 3 : Calculate

x = 8t2-t3+4

y=sin 30◦

z=e3t+5 

Step 4: Print the value of x,y and z.

Step 5: Stop the program.

PROGRAM CODE:
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
    float x,y,z,t;
    clrscr();
    printf("Enter the value of t :");
    scanf("%f",&t);
    x=8*pow(t,2)-t*t*t+4;
    y=sin(3.1415*30/180);
    z=exp(3.0*t +5.0);
    printf("nx = %.3f, y = %.3f, z= %.3f", x,y,z);
    getch();
}
OUTPUT:

evaluate

RESULT:

                    Thus the C program to evaluate given expressions is written and executed successfully.

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *