Write A Fortran Program To Read Radius And Calculate Area Of A Corresponding Circle And Volume Of The Coresponding Sphere

1.8 ( Area and perimeter of a circle) Write a program that displays the area and perim- eter of a circle that has a radius of 5.5 using the following formula: perimeter = 2 * radius * p area = radius * radius * p 1.9 ( Area and perimeter of a rectangle) Write a program.

1 Write a program to solve simultaneous equations a1 x + b1 y + c1 = 0 a2 x + b2 y + c2 = 0 Answer: ALGORITHM: 1 Input the values of a1, b1, c1, a2, b2, c2 2 Calculate the value x and y by using equations a1 x + b1 y + c1 = 0 a2 x + b2 y + c2 = 0 3 output the value of x and y 4 stop PROGRAM CODE: Write (*,*)’ enter the value of a1, a2, b1, b2, c1, c2’ Read (*,*) a1, a2, b1, b2, c1, c2 Write (*,*) ‘the value of x =’, x Y = (a2*c1*b1 – c2*b2*a1) / (b2**2*a1 – a2*b1) Write (*,*)’ value of y =’, y Stop End Question no. 2 Write a program to find the area of a triangle when two sides and angle between them are given. Answer: ALGORITHM: 1 Input the two sides of triangle i.e. A and b and angle between them is t in degree 2 Calculate the area of triangle by using a = ½ ab sin t 3 Output the area of triangle 4 Stop PROGRAM CODE: Write (*,*)’enter the two sides and angle between them of triangle’ Read(*,*)a, b, t A = (1/2)*a*b* sin ((22.0/7.0)*t/180.0) Write (*,*)’The area of triangle =’,a Stop End Question no. 3 Write a program to find the sum of squares of first n natural numbers Answer: ALGORITHM: 1 Input the values of squares of first n natural numbers 2 Calculate the sum of squares of first natural numbers by using Sum = n (n+1) (2n+1)/6 3 output the sum of squares of first natural numbers 4 stop PROGRAM CODE: Write (*,*)’enter the value of n’ Read (*,*) n Sum = n*(n+1)*(2*n+1)/6.0 Write (*,*) ‘the sum of n squares is =’, sum Stop End Question no. 4 Write a program to find the sides of a triangle using the formula c2 = a2 + b2 – 2ab cos t Answer: ALGORITHM: 1 Input the values of two sides and angle between them of triangle 2 Calculate the unknown side of triangle by using c2 = a2 + b2 – 2ab cos t 3 output the value of unknown side of triangle 4 stop 5 PROGRAM CODE: Write (*,*)’enter the two sides and angle between them of triangle’ Read (*,*) a, b, t C = sqrt(a**2+b**2-2*a*b*cos((22/7.0*t/180) Write (*,*) ‘the unknown side of triangle is =’,c Stop end.

1 Write an algorithm, flow chart and program coding to solve quadratic equation using arithmetic if. Answer: ALGORITHM: 1 input the co-efficient a, b and c 2 evaluate b2 – 4ac 3 if b2 – 4ac > 0 then Compute and print two distinct real roots. 4 otherwise if b2 – 4ac =0 Compute two equal roots 5 otherwise print no real roots 6 stop PROGRAM CODE: C process to solve quadratic equation Write (*,*)’ enter the values of a, b and c’ Read (*,*) a, b, c If (b**2 – 4*a*c) 9,8,10 9 write(*,*)’no real roots’ Go to 13 8 x1 = -b/ (2.0*a) x2 = x1 Go to 11 10 x1 = (-b + sqrt (b**2 – 4*a*c))/(2.0*a) x2 = (-b - sqrt (b**2 – 4*a*c))/ (2.0*a) 11 write (*,12)x1,x2 12 format (1x,’first root = ‘,f 6.2,/, ‘2nd root =’,f 6.2) 13 stop end Question no.

2 Write an algorithm, flowchart and program coding to check the given number is whether prime number or not. Answer: AKGORITHM: 1 Input the value of given number.

Gta iv crashes after installing mods. *This version can only be played in v. (this mod can麓t be uninstalled) How to install Just simply run the setup and pick out where your Gta 4 folder is and wait for the setup to be finished. *The mod can only be played in single player.(what i know of) *Be sure to backup your GTA 4 folder. 1.0.7.0 for GTA 4 or 1.1.2.0 for Liberty City Stories.

2 Assign p = 2 3 If (I>n/2) go to step 8 4 Calculate ir = n-(n/I)*I 5 If ir = 0 then print ‘ no prime number’ 6 Otherwise I = I +1 7 Go to step 3. 8 Print ‘prime number’ 9 Stop PROGRAM CODE: Real ir Write (*,*)’enter the number’ Read (*,*) n I = 2 2 if (i.gt.n/2) then Write (*,*)’prime number’ Go to 3 Else Ir = n – (n/i)*i If (ir.eq.0) then Write (*,*)’ no prime number’ Go to 2 3 endif Stop End Question no.

3 Write an algorithm, flowchart and program coding to input 4 Integer number and to find smallest number among them. Answer: ALGORITHM: 1 input 4 numbers i.e. 1 Write an algorithm, flow chart and a program code to find the maturity value of principle due to rate of compound interest using the formula.

Answer: ALGORITHM: - input the value of principle and rate of compound interest and no of year - calculate the maturity value by using, f=p(1+r/100)n - output the value of maturity - stop - PROGRAM CODE: Write(*,*)’enter the value of amount, rate of interest and no of year in order’ Read(*,*) p,r,n VM=p*(1+r/100)**n Write(*,*)’the maturity value=’,vm Stop End Question no. 2 Write a program to compute volume of metal in hollow steel cylinder, given data values for the inner radius,outer radius and length. Use formula Volume= (area of outer-area of inner circle)*length Answer: ALGORITHM: - input the value of outer radius, inner radius of circle and length - calculate the volume, using v =((22/7)*R2-(22/7)r2)*l - Output the value. - Stop - PROGRAM CODE: Write(*,*)’enter the value of outer, inner radius and length of cylinder in order’ Read(*,*) x,y,l V=((22/7)*x**2-(22/7)*y**2)*l Write(*,*)’the volume of cylinder=’,v Stop End Question no.