| From | Message | ||
|---|---|---|---|
|
dariustheking 26-Aug-09, 07:43 |
Help in BASICPlease tell me what are the answers to the following questions- 1) Write a program in basic to generate the series 5,10,15,20,25.....100. 2) Write a program in basic to accept a number and print whether it is postive or negative. 3) Write a program in basic to print the series 1,4,9,16,…100. 4) Write a program in basic to accept a number and find out whether the number is divisible by 3 or not. 5) Write a program in basic to print the series 0,3,8,15,24,35…99 6) Write a program in basic to accept the name and history and geography marks of a student and print his name and total marks obtained in history and geography. 7) Write a program in basic to accept five numbers and find their average. |
||
|
It had been awhile since I used BASIC, but I can point you in the right direction. For question 1, you're generating number series between 5 and 100. So, in English what you want the code to do is this: - Step 1: Number + 5 = Answer Step 2: If Answer is less than or equal to 100, Print Answer Step 3: Then made Number equal to Answer and Repeat Step 4: If Answer is greater than 100, End program Next you need to convert this into BASIC, which is different depending on what version you're using. In GW-BASIC, which is pretty old and so unlikely to be what you're working with, the structure would be something like: - 10: LET X = 5 15: PRINT X 20: IF X>100 THEN 40 25: LET Y = X + 5 30: LET X = Y 35: GO TO 15 40: END Obviously, if you meant QuickBasic or VisualBasic then this program won't work for you. But the overall way to perform the task is the same. All of the others are basically variations on the first, so fairly easy once you've figured out how to do the first. |