0% found this document useful (0 votes)
16 views5 pages

Adobe Scan Jan 13, 2025

Coding

Uploaded by

Anurag singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views5 pages

Adobe Scan Jan 13, 2025

Coding

Uploaded by

Anurag singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Open

Q1.f90 Q4.f90
1 program loop
2implicit none
3 integer:: n,i,sUm
4 SUm=0.0
5 Print*, enter how nany nunber to be added
6read*,n
7do i= 1,n
8 SU = SUm ti
9 end do
10 print*, the sUn ef first,n, nUnberis,sum
11 stop
12 end
Open

Q1.f90 Q4.f90
1 Program test
2 real::N
3double precision y,z
4X= 1.1
5y = 1.1
6 Z=1. 1DO
7 Print*,'x=',>
8 print*,'y=',y
9 Print*,z=',z
10 stop
11 end
Open v

Q1.f90 Q4.f90
1Progran business
2implicit none
3 real:: cost,discount, totalcost, newcost
4 integer:: n
S cost= 999,0
6 Print*, enter the nunber of items U want to buy!
7read*,n
s if (n>10) then
9 print*, Congrats you get a 25% discount
10 discount = 0.25
11 elseif (n>5 and. n.le. 10) then
12 print*,'Congrats you get a 15% discount'
13 discount= 0.15
14 elseif (n>1. and. n.le.5) then
15 print*,'Congrats you get a 10% discount
16 discount=0.1
17 else
18 print*,'Better luck next time'
19 discount= 0.0
20 endif
21 totalcost= n*cost
22 newcost -totalcost-(totalcost*discount)
23 Print*, the total cost of your product is ,totalcost
24 Print*,' you get the product at just Rupees ,newcost
25 stoP
26 end
Q1.F90
1Program anurag
2implicit none
3 real:: a,b,c,d,X,y
4 Print*,'enter the
5 read*, a,b,c
coffecients
6d = (b**2)-4*a*c
7 X= (-B+SORT(D))/(2*a)
8 y= (-B-SORT(D) )/(2*a)
9 if (d .GE.0 )then
10 print *,roots
* are Teal
11 print* the root i s ,X, andy
12 endif
13 if (d<0 )then
14 print*, the roots are imaginary
15 endif
16 stop
17 end
Open v

Q1.f90 04.F90

1 Program arithmetics
2 implicit none
3 real:: Value
4 value = ((1-/3.)*Log((1. tsqrt(2)))+(1-/L5 )*(2.tsqrt(2.)))
5 print*, the value of the givenStatenent ts ,value
6 stop
7 end

You might also like