If they
are unequal then
display the greatest number, otherwise display they are equal. The
program also
displays whether the numbers entered by the user are ‘All positive’,
‘All Negative’ or
‘Mixed numbers’.
Sample Input: 56, -15, 12
Sample Output: The Greatest number is 56
Entered numbers are mixed numbers.
//
0 0 0)
0 0 0)
Variable Type Use
a int to store the first number
b int to store th second number
c int to store the third number
gn int to store the greatest out of the three numbers
//
10)
80
10 20)
80+( 10)*6
20 30)
80+10*6+( 20)*5
80+10*6+10*5+( 30)*4
Variable Type Use
d int To store the distance travelled
f int To store the fare to be paid
Condition Nature
if d>=0 Roots are real
if d<0 Roots are imaginary
Write a program to determine the nature and the roots of a quadratic
equation, taking
a,b,c as input. If d=b2-4ac is greater than or equal to zero, then
display ‘Roots are
real’, otherwise display ‘Roots are imaginary’.
The roots are determined by the formula as:
r1=-b+ b2-4ac , r2= -b – b2-4ac
2a 2a
//
1 2
4*
0)
1=(- 4* 1/2))/2*
2=(- 4* 1/2))/2*
1+" 2)
Variable Type Use
a int to store to value of a as in a quadratic
equation
b int to store to value of b as in a quadratic
equation
c int to store to value of c as in a quadratic
equation
d int to store to value of discriminant
r1 double to store the first root
r2 double to store the second root
1.
2.
3.
1:
2:
4/3.0)*(22/7)*
3:
Variable Type Use
ch int to store the choice of the user
s int to store the side of a cube
r int to store the radius of a sphere
l int to store the length of cuboid
b int to store the breadth of cuboid
h int to store the height of cuboid
v double to store the volume of cube or sphere or cuboid