N

@nazir_168

multiplication

Fortran
4 years ago
program main implicit none integer :: x,y,p,product,i product = 0 print*,"enter the numbers" read*, x,y if (x>0) p = x if (x<0) p= -x do i=1 , p,1 product = product +y

sum of series

Fortran
4 years ago
program main implicit none integer :: sum, k sum = 1 do k = 1,19 sum = sum + 3**k end do print*, "sum =", sum end program main

111

Fortran
4 years ago
program main implicit none integer :: a,b,c,d,ang print *,"enter 4 sides" read *,a,b,c,d print *,"enter angle" read *,ang if (a.eq.b .and. b.eq.c .and. c.eq.d .and. ang .eq. 90) then print *,"square" else if (a.eq.b .and. b.eq.c .and. c.eq.d .and. ang .ne. 90) then

gftrhg

Fortran
5 years ago
program cheak_four implicit none real::x1,x2,x3,x4,y1,y2,y3,y4,a,b,c,d,p,q, angle print*,'enter the value of x1 & y1' read*,x1,y1 print*,'enter the value of x2 & y2' read*,x2,y2 print*,'enter the value of x3 & y3' read*,x3,y3 print*,'enter the value of x4 & y4'

write a fortran program vertices are given verify its square or Rhombus or Parallelogram or rectangle

Fortran
5 years ago
program main IMPLICIT none INTEGER :: A,B,C,D,ANG PRINT *,"ENTER 4 SIDES" read *,A,B,C,D PRINT *,"ENTER ANGLE" read *,ANG IF(A.EQ.B .AND. B.EQ.C .AND. C.EQ.D .AND. ANG .EQ.90) THEN PRINT *,"SQUARE" ELSEIF(A.EQ.B .AND. B.EQ.C .AND. C.EQ.D .AND. ANG.NE.90) THEN

fdgg

Fortran
5 years ago
program main implicit none real :: a,b,c print*, "enter the value of a,b,c" read*, a,b,c if ((a .gt. c).and. (c .gt. b)) then print*, "the maximum value is ", a print*, "the minimum value is ",b endif if (b.gt.a .and. c.gt.b) then

largest and smallest no

Fortran
5 years ago
program main implicit none integer :: a,b,c,max,min print*, "enter three numbers" read*, a,b,c max = a if(b>max) max = b if(c>max) max = c min = a if (b<min) min = b

finding leap year

Fortran
5 years ago
program main implicit none integer :: y print*, "enter the year" read*, y if (mod(y,100)== 0)then if (mod(y,400)== 0) then print*, "leap year" else print*, "not leap year"

factorial of a number

Fortran
5 years ago
program main implicit none integer :: i,n,f print*, "enter the value of n" read*, n f = 1 do i = 1,n f = f*i end do print*, "factorial=",f

roots of quadratic equation

Fortran
5 years ago
program main implicit none real :: a,b,c,d,r1,r2 print*, "enter the values ofa,b,c in equation ax**2 + bx + c= 0" read*, a,b,c d = b**2 - 4*a*c if (d.gt.0) then print*, "roots are real" r1 = (-b+d**0.5)/(2*a) r2 = (-b-d**0.5)/(2*a)

largest of three numbers 2

Fortran
5 years ago
program main implicit none integer :: a,b,c print*, "enter the values of a,b,c" read*, a,b,c print*, "a = ",a , "b= ",b,"c =",c if (a>b) then if (a>c) then print*,"a is largest ",a else

largest of three numbers

Fortran
5 years ago
program main implicit NONE integer :: num1, num2, num3 print*, "enter the values of num1,num2,num3" read*, num1,num2,num3 print*, "num1 =",num1, "num2 =",num2, "num3 =",num3 if (num1 .gt. num2) goto 5 if (num2>num3) then

integer sum

Fortran
5 years ago
program main implicit none integer :: k,sum k = 1 sum = 0 6 sum = sum + k k = k + 1 if (k .le. 100) goto 6 print*, "sum = ", sum stop

cost of mango by conditional statement

Fortran
5 years ago
program cost_mango implicit none real :: x ! cost per dozen real :: y ! discount integer :: rupees, paise,cost integer :: z ! quantity read*,x,y ,z print*, "cost of one dozen mangoes = ",x, "quantity = ",z if(z>60) then y = y

addition of time

Fortran
5 years ago
program main implicit none integer :: h1,m1,s1,h2,m2,s2,h3,m3,s3,h,m print*, "enter the time 1 in HH:MM:SS" read*, h1,m1,s1 print*, "enter the time 2 in HH:MM:SS" read*, h2,m2,s2 s3 = s1+s2 m = s3/60 s3= mod(s3,60)

convert in seconds

Fortran
5 years ago
program main implicit none integer :: s integer :: HH ! hour integer :: MM ! minute integer :: SS ! second print*, "enter the values of HH,MM,SS" read*, HH,MM,SS s = ((HH*3600)+(MM*60)+SS) print*, "second",s

distance between two points in a plane

Fortran
5 years ago
program main implicit none real :: x1,y1 ! coordinates of first point real :: x2,y2 ! coordinates of second point real :: d ! distance print*,"enter the value of x1,y1" read*,x1,y1 print*,'enter the value of x2,y2' read*,x2,y2 d =sqrt((x1-x2)**2+(y1-y2)**2)

summing a series

Fortran
5 years ago
program summing_a_series implicit none real :: x,x2,x4,x6,x8,x10,sum print*, "enter the value of x" read*, x x2 = x*x/2 x4 = x2*x2/24 x6 = x4*x2/30 x8 = x6*x2/56 x10 = x8*x2/90

conversion from Celsius to Fahrenheit

Fortran
5 years ago
program temp_conversion implicit none real :: c ! censius real :: f ! fahrenheit print*, "enter the valeu of c" read*, c f = 1.8*c + 32.0 print*, "fahrenheit", f end program temp_conversion

write a fortran program vertices are given verify its square or Rhombus or Parallelogram or rectangle

Fortran
5 years ago
!write a fortran program vertices are given verify its square or Rhombus or Parallelogram or rectangle program cheak_four implicit none real::x1,x2,x3,x4,y1,y2,y3,y4,a,b,c,d,p,q print*,'enter the value of x1 & y1' read*,x1,y1 print*,'enter the value of x2 & y2' read*,x2,y2 print*,'enter the value of x3 & y3'