You are on page 1of 1

BDA24202 COMPUTER PROGRAMMING

OPERATORS AND EXPRESSION

Name:
Matrix no:
Section:
___________________________________________________________________________
Please obtain the answers for below C-codes without using any C-program. You need to
provide the steps to obtain each answer.

Example:
C codes #include<stdio.h>
#include<math.h>
Int main()
{ int a=2,b=4,c=144,d;
float x,y,z;
d=pow(a,b)+sqrt(c)+2;
printf(“%d”,d);
x=sin(x*10)+sqrt(b+c);
printf(“%.2f”,x);
return 0;
}
Answer d=pow(a,b)+sqrt(c)+2 x=sin(a*10)+sqrt(b+c);
d=pow(2,4)+sqrt(122)+2 x=sin(2*10)+sqrt(4+144);
d=24 + sqrt(122)+2 x=sin(20)+sqrt(148);
d=16+ sqrt(144)+2 x= 12.17
d=16+ 12+2
d=30

Question:
C codes #include<stdio.h>
#include<math.h>
int main()
{ int a=2,b=5,c=6,d,k;
float x,y,z;

d=a/2*4+pow(b-2,c+a);
d+=b;
printf(“%d”,d);

x=15;
y=cos(x)+tan(c+b);
printf(“%.2f”,y);

z=sqrt(pow(12/2+2,b-a+2));
printf(“%.2f”,z);

k=z>y?100:200;
printf(“%d”,k);
return 0;
}
Answer(s)

You might also like