a-assuming x=5 and y=8 the output is
@@@@@@
$$$$$$
&&&&&&
b- assuming x=5 and y=8 the output is
@@@@@@
c- assuming x=5 and y=8 the output is
@@@@@@
&&&&&&
d- assuming x=5 and y=7 the output is
######
$$$$$$
&&&&&&
-----------------------------------------------------------------------
problem #4
Write the program that solves quadratic equations .a quadratic equation is an equation of the form (ax2+bx+c=0) , where a ,b and c are given coefficients and x is the unknown :
_ first , you should get values for the coefficients a, b, and c to calculate the discriminate (d) d=b2 - 4*a*c.
_if (d is less than zero ), there is no solution for the equation and print "there is no root".
_if (d is equal to zero ), there is one real solution (x1= -b/(2*a)).
_if (d is greater than zero ), there are two real roots :
X1=(-b+ sqr t(d))/(2*a)
X2=(-b- sqrt(d))/(2*a)
-----------------------------------------------------------------------
problem #5
Write c++ program that reads an integer value n (33>n>0), then prints a series of terms as following :
_the first term should be the value of n
_if the current term=1 the iteration will stop.
_if the current term is (even number ),the next term=current term/2
_if the current term is (odd number ),the next term=1+current term*3
Enter the value of n (0
The result of series where n=6 is :
6,3,10,5,16,8,4,2,1