**Practical: 1- Write a Program to Print even numbers from 1 to 40.**

**Program:**

10 CLS

20 FOR B = 2 TO 40 STEP 2

30 PRINT B

40 NEXT B

50 END**Algorithm**

Step 1 START

Step 2 STORAGE B=2

Step 3 DECISION IS B<= 40 IF

NOT THEN GO TO STEP 7

Step 4 COMPUTE B=B+2

Step 5 PRINT

STEP 6 GOTO STEP 3

Step 7 END

**Algorithm**

Step 1 START

Step 2 INPUT L , W

Step 3 COMPUTE AREA = L * W

Step 4 PRINT AREA

Step 5 END

**Practical: 11: Write a program that can calculate the perimeter of the rectangular**.

**Program:**

10 CLS

20 INPUT “Length …=”;L

30 INPUT “Width …=”; W

40 PERIMETER= 2* ( L+W)

50 PRINT “ PERIMETER….. =”; PERIMETER

60 END

**Algorithm**

Step 1 START

Step 2 INPUT L , W

Step 3 COMPUTE PERIMETER = 2* ( L+W)

Step 4 PRINT PERIMETER

Step 5 END**Practical: 12: Write a program that can calculate the square and cube of any number.**

**Program:**

10 CLS

20 INPUT “ Enter any No..…=”; N

30 Sq = N*N

40 Cub= N^3

50 PRINT “ Square….. =”; Sq

60 PRINT “ Cube….. =”; Cub

70 END

**Algorithm**

Step 1 START

Step 2 INPUT N

Step 3 COMPUTE Sq = N*N

Step 4 COMPUTE Cub = N^3

Step5 PRINT Sq ,Cub

Ste

**Practical: 13: Write a program that can convert temperature from Centigrade to Fahrenheit**

**Program:**

10 CLS

20 INPUT “ Temperature in Centigrade :=”; C

30 F = 9/5* C+32

40 PRINT “Temperature in Fahrenheit =”; F

50 END

**Algorithm**

Step 1 START

Step 2 INPUT C

Step 3 COMPUTE F = 9/5* C+32

Step 4 PRINT F

Step 5 END

**Practical: 14:**

**Write a program that can convert temperature from Fahrenheit to Centigrade**

**Program:**

10 CLS

20 INPUT “ Temperature in Fahrenheit :=”; F

30 C = 5/9* ( F-32)

40 PRINT “Temperature in Centigrade =”; C

50 END

**Algorithm**

Step 1 START

Step 2 INPUT F

Step 3 COMPUTE C = 5/9* ( F-32)

Step 4 PRINT C

Step 5 END

**Practical: 15: Write a program that can draw a Triangle.**

**Program:**

10 CLS

20 SCREEN 2

30 LINE (110,50)- (160,100)

40 LINE (60,100)- (160,100)

50 LINE (110,50)- (60,100)

60 END

**Algorithm**

Step 1 START

Step 2 PRINT SCREEN 2

Step 3 OUTPUT LINE (110, 50) - (160,100)

Step 4 END

**Practical: 16: Write a program that can draw a Rectangle.**

**Program:**

10 CLS

20 SCREEN 2

30 LINE (70,80)- (190,170),,B

40 END**Algorithm**

Step 1 START

Step 2 PRINT SCREEN 2

Step 3 OUTPUT LINE (70, 80) - (190,170),, B

Step 4 END**Practical: 17: Write a program that can add 15+ 30+20+325.**

**Program:**

10 CLS

20 READ A,B,C,D

30 SUM= A+B+C+D

40 PRINT “SUM OF 15,30,20 AND 325 IS…=”; SUM

50 DATA 15,30,20,325

60 END

**Algorithm**

Step 1 START

Step 2 STORAGE A=1

Step 3 DECISION IS A <=4, IF NOT THEN GOTO STEP 8

Step 4 COMPUTE A=A+1

Step 5 COMPUTE SUM = SUM +5^A

Step 6 PRINT 5^A, SUM

Step 7 GOTO STEP 3

Step 8 END**Practical: 18: Write a program that can print all odd numbers from 1 to 100**.

**Program:**

10 CLS

20 FOR N = 1 TO 100 STEP 2

30 PRINT N

40 NEXT N

50 END

**Algorithm**

Step 1 START

Step 2 STORAGE N=1

Step 3 DECISION IS N <=100, IF NOT THEN GOTO STEP 7

Step 4 COMPUTE N=N+2

Step 5 PRINT N

Step 6 GOTO STEP 3

Step 7 END

**Practical: 19: Write a program that can print all even numbers from 2 to 100**.

**Program:**

10 CLS

20 FOR B = 2 TO 100 STEP 2

30 PRINT B

40 NEXT B

50 END**Algorithm**

Step 1 START

Step 2 STORAGE B=2

Step 3 DECISION IS B <=100, IF NOT THEN GOTO STEP 7

Step 4 COMPUTE B=B+2

Step 5 PRINT B

Step 6 GOTO STEP 3

Step 7 END**Practical:20: program that can Print you name five times using FOR-NEXT**

**Loop**

**Program:**

10 CLS

20 FOR N =1 TO 5

30 PRINT “GOD IS GREAT”

40 NEXT N

50 END

**Algorithm**

Step 1 START

Step 2 STORAGE N=1

Step 3 DECISION IS N<=5, IF NOT THEN GOTO STEP 7

Step 4 PRINT GOD IS GREAT

Step 5 COMPUTE N=N+1

Step 6 GOTO STEP 3

Step 7 END

**Practical:2 :Write a Program to add two numbers.**

**Algorithm**

Step 1 START

Step 2 INPUT N1 ,N2 B=2

Step 3 COMPUTE SUM N1+N2

Step 4 PRINT SUM

Step 5 END

**Practical: 3: Write such program which can read six numbers and print their average**.

**Algorithm**

Step 1 START

Step 2 INPUT N1, N2, N3, N4, N5, N6

Step 3 COMPUTE AVG=( N1+N2+N3+N4+N5+N6) /6

Step 4 PRINT AVG

Step 5 END

**Practical: 4: Write a program which can find the largest number of given three numbers.**

**Algorithm**

Step 1 START

Step 2 INPUT N1, N2, N3

Step 3 DECISION IS N1> N2 AND N1 > N3 IF YES THEN PRINT N1

Step 4 DECISION IS N2> N1 AND N2 > N3 IF YES THEN PRINT N2

Step 5 ELSE PRINT N3

Step 6 END

**Practical: 5: Write a program that can calculate the sum and average of four numbers.**

**Algorithm**

Step 1 START

Step 2 INPUT N1, N2, N3, N4

Step 3 COMPUTE SUM= N1, N2, N3, N4

Step 4 COMPUTE AVG= SUM/4

Step 5 PRINT SUM,AVG

Step 6 END

**Practical: 6: Write a program that can draw a circle in a square.**

**Program:**

10 CLS

20 SCREEN 2

30 CIRCLE ( 100,100), 50

40 LINE ( 168,35)- (472,165),,B

50 END

**Algorithm**

Step 1 START

Step 2 PRINT SCREEN 2

Step

3 PRINT CIRCLE(100,100),50

3 PRINT CIRCLE(100,100),50

Step 4 PRINT LINE (168,35)- (472,165),,B

Step 5 END

**Practical: 7:**

**Write a program that can calculate the area**

**of a circle**.

**Algorithm**

Step 1 START

Step 2 INPUT N=R

Step 3 COMPUTE AREA =3.14*R*R

Step 4 PRINT AREA

Step 5 END

**Practical: 8: Write a program that can draw a circle.**

**Program:**

10 CLS

20 SCREEN 2

30 CIRCLE ( 100,100), 50

40 END

**Algorithm**

Step 1 START

Step 2 PRINT SCREEN 2

Step

3 PRINT CIRCLE(1000,100),50

3 PRINT CIRCLE(1000,100),50

Step 4 END

**Practical: 9: Write a program that can find the value of a solid cylinder**

**Algorithm**

Step 1 START

Step 2 INPUT R , H

Step 3 COMPUTE VOL= 3.14*R^2*H

Step 4 PRINT VOL

Step 5 END

**Practical:10: Write a program that can calculate the area of a rectangle**

good explanation,nice evironment i really appreciate u very much helpful for me.

ReplyDeletewww.programminginbasic.webs.com

ReplyDeletemoved to:

Deletehttps://gwbasicprograms.webs.com/

Do you want to get free amazingly cool programs including games. Each advance than previous. Click here http://adf.ly/1iLsXP

ReplyDeletethat was good

ReplyDeleteYour blog took me some decades back when I started learning computers.

ReplyDeleteI really like GW-BASIC and your blog took me back in time when I started learning GW-Basic.

ReplyDeleteToo Good!!!

ReplyDeleteGood GW Basic this is the very 1st programming language when i started learning programming i was as grad 5.

ReplyDeletekindly some one share the program to get full name of any person and return the number of characters in his first name.

ReplyDelete10 N$ = ""

Delete20 FN$ = ""

30 D$ = " "

40 DI = 0

50 PRINT "Enter your full name: ";

60 INPUT N$

70 N$ = TRIM$(N$)

80 IF N$ = "" THEN GOTO 200 END IF

90 DI = INSTR(N$, D$)

100 IF DI = 0 THEN

110 FN$ = N$

120 ELSE

130 FN$ = MID$(N$, 1, DI)

140 END IF

150 PRINT "Number of characters in your first name [ ";

160 PRINT FN$;

170 PRINT " ] = ";

180 PRINT LEN(FN$)

190 GOTO 10

200 END

I posted above code thinking some visitor may need it.

DeleteI used following site for testing above code and there it was working fine.

https://www.jdoodle.com/execute-yabasic-online

Mr.Khursheed can you tell me the program to print the smallest number using for/next statement and also using only one input statement

DeleteSmallest number out of what?

DeleteThis comment has been removed by the author.

Delete10 cls

Delete20 input "enter your full name:",nm$

30 nl = len(nm$)

40 fl = 0

50 for I = 1 to nl

60 sc$ = mid$(nm$,I,1)

70 if sc$ = " " then 90 else fl = fl + 1

80 next I

90 print "first name legth = ";fl

100 end

On 90 I have mistakenly type "legth" instead of "length"

DeleteBut program still work fine because

It is just a prompt string dialog

Open this link to see the snapshot of the code in action

Deletehttps://drive.google.com/file/d/1jsJL7Xb6iUGRLJOS02M-8aZj_Czhp9nX/view?usp=drivesdk

Lear Short courses free Short Courses24

Deletefor further lectures please contact 0333 3322391

ReplyDeleteFLS?

ReplyDeleteHi u were shaded my life did u feel us another start i faded was it all my fantsy

ReplyDeleteThis comment has been removed by the author.

DeleteThis comment has been removed by the author.

ReplyDeleteThis comment has been removed by the author.

ReplyDelete*****

ReplyDelete****

***

**

*

by using read and data stament in gw basic

10 cls

Delete20 for I = 1 to 5

30 read x$

50 print x$

60 next I

70 data "*****","****","***","**","*"

80 end

Open this link to see the snapshot of the code in action

Deletehttps://drive.google.com/file/d/125FvDmrPVkLO64t6MdLszRHLZeuEiPwJ/view?usp=drivesdk

can anyone tell me the program to print the smallest number using for/next statement and also using only one input statement

ReplyDeleteSmallest number out of what?

ReplyDeleteThis comment has been removed by the author.

ReplyDelete10 CLS

ReplyDelete20 LET a = 0

30 LET b = 0

40 FOR I = 1 TO 10

50 PRINT "Enter number: ";

60 INPUT b

70 IF b < a THEN

80 a = b

90 ENDIF

100 NEXT I

110 PRINT "Smallest number is: ";

120 PRINT a

130 END

Above code takes 10 number input from keyboard in FOR loop and then prints smallest number out of all 10 numbers just entered.

ReplyDeleteIf I understood your question correctly then hopefully code I posted in previous post will solve your problem.

HOW TO PRINT

ReplyDelete*

***

USING LOOP

wap to store2 in 'a' and 3 in 'b' and print the result of the equation

ReplyDeleteQ=a2+b2+2ab

10 let a = 2

ReplyDelete20 let b = 3

30 let q1 = (a ^ 2) + (b ^ 2) + (2 * a * b)

40 print "Result of Q=a^2+b^2+2ab = ", q1

50 let q2 = (a * 2) + (b * 2) + (2 * a * b)

60 print "Result of Q=a2+b2+2ab = ", q2

Ramkrishna Ganguly:

ReplyDeleteIf you are asking for (a Square + b Square + 2ab) then q1 is answer to your question otherwise q2 is answer to your question.

I think people are asking for solution for their home work etc.

ReplyDeleteTherefore I will not post any more solution here.

Thanks.

These Are Easy Baby Programs

ReplyDeleteTry These Ones Mostly Made By Me

www.gwbasicprograms.webs.com

write a programe to compute s value where s=1-1/3+1/5-1/7+.....1/x

ReplyDelete10 cls

Delete20 s = 1

30 input "enter x:",x

40 state = -1

50 for I = 3 to x step 2

60 if state = -1 then 70 else goto 90

70 s = s - (1/I)

80 state = 1: goto 110

90 s = s + (1/I)

100 state = -1

110 next I

120 print s

130 end

This is based on Daniyal yousaf's solution he posted on October 5, 2018 at 4:26 AM.

Delete---

10 CLS

20 s = 1

30 INPUT "Enter x: ",x

40 state = 1

50 FOR I = 3 to x STEP 2

60 state = (state) * (-1)

70 s = s + ((state) * (1/I))

80 NEXT I

90 PRINT s

100 END

Here's the snapshot of code in action

Deletehttps://drive.google.com/file/d/1Vafz0OB_l4yYv6uVrKOzlQ23Pvqw8Ys3/view?usp=drivesdk

Just open this link

write a program to input any number then determine if the number is odd or

ReplyDelete10 CLS

Delete20 INPUT "ENTER NUMBER: ",X

30 IF X MOD 2 = 0 THEN GOTO 40 ELSE GOTO 50

40 PRINT X " is even." :END

50 PRINT X " is odd."

60 END

I need gwbasic compiler ?

ReplyDeleteWap to print the following pattern using semicolon

ReplyDelete*

***

*****

Auto

Delete10 cls

20 new

30 rem

40 print "*"

50 print "***"

60 print "*****"

70 end

@

ReplyDelete@@@

@

Same as above

if you want to practice and learn Gwbasic

ReplyDeleteDownload this app from play store for your android

https://play.google.com/store/apps/details?id=umairayub.gwbasic

how to bring multiple names in according to alphabetic order ? and how to take out the percentage of so many students to calculate their marks?

ReplyDeleteThis program shows how to sort names: https://github.com/udhos/basgo/blob/master/basparser-samples/bubble.bas

DeleteThis is a total fake.

ReplyDeletethanks yaar right hai yaar tu

DeleteThis is a total fake.

ReplyDeleteyes bro you are right thanks yaar

DeleteSir algorithm to find zakat ka program.

ReplyDeleteSir plz send krdein subah exam he.

ReplyDeletevery helpful blog

ReplyDeletehow to make flow chart of sub routine

Write down a program which print reverse counting from 10 to 01 on screen

ReplyDeleteto bad kohi be good nahi

ReplyDeleteLear Short courses free Short Courses24

DeleteVery GoodShort Courses24

ReplyDeleteCan you plz tell a program for car parking system. Consisting of 1 dimensional array

ReplyDelete👍

ReplyDeleteThank you very much for seeing 밤알바 information.

ReplyDeleteThank you very much for seeing 밤알바 information.

Mr.Khursheed actually the program you have given above is bit difficult to understand.....

ReplyDeleteI am a student of matriculation,obviously a beginner..so plz give a easy program getting full name of person and giving first name length.

what is difficult?

Delete10 cls

Delete20 input "enter your full name:",nm$

30 nl = len(nm$)

40 fl = 0

50 for I = 1 to nl

60 sc$ = mid$(nm$,I,1)

70 if sc$ = " " then 90 else fl = fl + 1

80 next I

90 print "first name legth = ";fl

100 end

See the code in action at link below

Deletehttps://drive.google.com/file/d/1jsJL7Xb6iUGRLJOS02M-8aZj_Czhp9nX/view?usp=drivesdk

Hejdhdjs

ReplyDeleteNice

ReplyDeleteMake money online from home Find work from

ReplyDeleteBest Home Base Typing Jobs onlinewithout any investment or registration fees Visit our best website for more details.Write a program to assign 5 numbers calculate total and average and print them

ReplyDeleteWRITE A PROGRAM TO GENERATE A 5 TIMES TABLE USING LET STATEMENT

ReplyDeleteThe world's largest independent employment opportunity without registration is free to register for Google Data Entry jobs free from online work at home.

ReplyDeleteWrite a program in gw basic to display four vegetables name in different zones.

DeletePlease help me.

Very good site, I found more programming commands for gw basic here than any where else.

ReplyDeleteWrite a program in gw basic to display four vegetables name in different zones.

DeletePlease help me.

Write a program in gw basic to display four vegetables name in different zones.

ReplyDeletePlease help me.

What do you mean by zones?

DeleteCan you explain me how the output look like?

DeleteThis comment has been removed by the author.

ReplyDeleteI am in search of a BASIC program which prints results of permutations and combinations of say "a","b","c","d","e".Taken all 5 together.

ReplyDeleteHere Permutations are 120 and combinations are 3125 with repetitions.

I am in search of a BASIC program which prints results of permutations and combinations of say "a","b","c","d","e".Taken all 5 together.

ReplyDeleteHere Permutations are 120 and combinations are 3125 with repetitions.Without using "SWAP" command.

E

ReplyDeleteWrite a program to print and check whether the number is divisible by 7 or not

ReplyDeletePlease ANSWER for this question

Write a program to print and check whether the number is divisible by 7 or not

ReplyDeletePlease ANSWER for this question

Write a program to print and check whether the number is divisible by 7 or not

ReplyDeletePlease ANSWER for this question

10 CLS

Delete20 INPUT "ENTER NUMBER: ",X

30 IF X MOD 7 = 0 THEN GOTO 40 ELSE GOTO 50

40 PRINT X " is divisible by 7." :END

50 PRINT X " is not divisible by 7."

60 END

10 CLS

Delete20 INPUT "ENTER NUMBER: ",X

30 IF X MOD 7 = 0 THEN GOTO 40 ELSE GOTO 50

40 PRINT X " is divisible by 7." :GOTO 60

50 PRINT X " is not divisible by 7."

60 END

Because it is good to have one END per program

DeleteWap to print twin prime number.

ReplyDeleteWrite a programe to the series of N terms

ReplyDeleteDo you want to write a program get a number N from a user then print numbers from 1 to that number N?

Deletewrite a program which can calculate the square of any number

ReplyDelete10 CLS

Delete20 INPUT "Enter number:", n

30 s = n * n

40 PRINT "saquare of "; n; " is "; s

50 END

Write a program of 10 students, subject and their marks

ReplyDeleteI hope it will be helpful for almost all peoples that are searching for this type of topic. I Think this website is best for such topic. good work and quality of articles. 먹튀검증

ReplyDeleteA good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one. 먹튀폴리스

ReplyDeleteRARARA KAKAKLAKA HAHAHA JAJAJA CHALA JA BOSRI KE

ReplyDeleteIf we talk about printers first name comes in our head is Canon Printers, for latest and updated Drivers for Canon go to the Following Sites.

ReplyDeletewww.canon.com/ijsetup

www.canon.com/ijsetup

www.canon.com/ijsetup

www.canon.com/ijsetup

www.canon.com/ijsetup

www.canon.com/ijsetup

www.canon.com/ijsetup

www.canon.com/ijsetup

If we talk about printers first name comes in our head is Brother Printers, for latest and updated Drivers for Brother go to the Following Sites.

ReplyDeletesolutions.brother.com/windows

solutions.brother.com/windows

solutions.brother.com/windows

solutions.brother.com/windows

write a program to show the smallest number of a 1d array ????

ReplyDelete