Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need solutions for these problems, I prefer to get the answers for some proble

ID: 3886670 • Letter: I

Question

I need solutions for these problems, I prefer to get the answers for some problems using printf and scanf not cout and cin.

1. Write a program to generate cartesian co-ordinates (z,y), if the polar co-ordinates (r. ) of a point are provided. The transformation holds the following relationship: x = r cos and y-r sin . C's default angles are in radians. The conversion from degrees to radians is given by: degrees radians10 P (x, y) FIG. 1: Question 1. 2. What is the value ofi calculated by each of the following statements? (no program is necessary) (a) int i, j-3, k-6; i-j*2/3+k/4+6-j*j*j/8 (b) int i, j-3; i-j/2*4+3/8+j *j *3%4 3. Evaluate the following expressions if: float a-2.5, b-2.5; (no program is necessary) (a) a+2.5/b+4.5 (b) (a+2.5)/b+4.5 (d) a/2.5/b

Explanation / Answer

2) a) int i,j=3,k=6;
i=j*2/3+k/4+6-j*j*j/8;
Answer: Value of i = 6
Explanation:
Program:

#include <stdio.h>

int main(void) {

int i,j=3,k=6;

i=j*2/3+k/4+6-j*j*j/8;

printf("Value of i = %d",i);

return 0;

}
Output:
Value of i = 6

b) int i,j=3;
i=j/2*4+3/8+j*j*j%4;

Answer: Value of i = 7

Explanation:
Program:

#include <stdio.h>
int main(void) {
int i,j=3;
i=j/2*4+3/8+j*j*j%4;

printf("Value of i = %d",i);
return 0;
}
Output:
Value of i = 7

3) a) Given float a=2.5,b=2.5;

a) a+2.5/b+4.5;

Answer: 8.0000

Explanation:

Program:

#include <stdio.h>

int main(void) {

float a=2.5,b=2.5,c;

c=a+2.5/b+4.5;

printf("Value of c = %f",c);

return 0;

}

Output:

Value of c = 8.000000

3) b)(a+2.5)/b+4.5;

Answer: 6.500000

Explanation:

Program:

#include <stdio.h>

int main(void) {

float a=2.5,b=2.5,c;

c=(a+2.5)/b+4.5;

printf("Value of c = %f",c);

return 0;

}

Output:

Value of c = 6.500000

3) c)(a+2.5)/(b+4.5);

Answer: 0.714286

Explanation:

Program:

#include <stdio.h>

int main(void) {

float a=2.5,b=2.5,c;

c=(a+2.5)/(b+4.5);

printf("Value of c = %f",c);

return 0;

}

Output:

Value of c = 0.714286

3) d)a/2.5/b;

Answer: 0.400000

Explanation:

Program:

#include <stdio.h>

int main(void) {

float a=2.5,b=2.5,c;

c=a/2.5/b;

printf("Value of c = %f",c);

return 0;

}

Output:

Value of c = 0.400000

3)

e)b++/a+b--;

Answer: 4.500000

Explanation:

Program:

#include <stdio.h>

int main(void) {

float a=2.5,b=2.5,c;

c=b++/a+b--;

printf("Value of c = %f",c);

return 0;

}

Output:

Value of c = 4.500000

4) float b;
int i;
b=2.54;
b=(b+0.05)*10;
i=b;
b=i;
b=b/10.0;

Answer: Value of b = 2.500000

Explanation:

Program:

#include <stdio.h>

int main(void) {

float b;

int i;

b=2.54; // Here we Replacing value of b 2.56 by 2.54

b=(b+0.05)*10;

i=b;

b=i;

b=b/10.0;

printf("Value of b = %f",b);

return 0;

}

Output:

Value of b = 2.500000