Classwork Applications For C++ Operators & Intrinsic Functions
Classwork Applications For C++ Operators & Intrinsic Functions
Correct the program given below that calculates the function for arbitrary values of x.
#include <iostream> using namespace std; int main() { double x,fx; cout<<"input x\n"; cin>>x; fx=x/3-pow(x,3)/(x-3/2); cout<<"fx ="<<fx system ("pause"); }
Sample Output
input x 2 fx =-14.6667
b) z a
b cd
c) z
a b d c
a b d c ef
Q3. Write a program to find the Cosines and Sines of angles at points A, B,C and D at the unit circle.
B (0,1) C(-1,0) A (1,0)
D (0,-1)
Q4. Write a program to read the lengths of the two sides of a right angle triangle and calculate and display the area of the triangle (one-half the product of sides) and the length of the hypotenuse (square root of the sum of the squares of the sides).
Q5. Find the result of the following arithmetic operation; double( floor(5.2) / ceil(-2.7) ) + 5%2
Q7. Find the result of each line int the following program section: double x=10.0, y=0.01, z=0.5 ; int i=10, j=25, k=3 ; cout << ceil(j/x)+floor(x+j/2) ; cout << z * x / 10 + k ; cout << z * k + z * j + z * i ; cout << i * y - k / x + j ; Q8. Write a program to calculate the following function:
Q9. Write a program to obtain the following table for your friends:
Name Ali
Surname Can
City stanbul