Math, asked by vinaykantjha88, 6 months ago

Write a program in Qbasic to accept student's name and marks of six subjects. Find the sum and average. Display the sum name and average....​

Answers

Answered by shahkhushee700
3

Step-by-step explanation:

The simplest way might be for you to supply the five numbers. This works in Qbasic:

PRINT (2 + 3 + 5 + 7 + 11)/5

and when run, returns 5.6 as expected. You can change the values and the number of values, remembering to divide by the number of values.

For something more advanced, you could use:

NumberOfNumbers = 5

Sum = 0

Average = 0

FOR i = 1 TO NumberOfNumbers

PRINT "Enter Number."

INPUT Number

LET Sum = Sum + Number

NEXT i

Average = Sum / NumberOfNumbers

PRINT "The average of these ", NumberOfNumbers, "numbers is ", Average

END

You can see the code for many simple tasks in many different languages (including some forms of BASIC) here:

This tutorial on Qbasic is VERY easy and thorough, proceeding very slowly:

Is this the type of BASIC you are using, or does yours still require line numbers?

If you are using structured BASIC such as Qbasic, here is a great modern, free version called QB64, which is compatible with Qbasic, that you can download and install:

You could then use the Programmed Lessons in QBasic above link to learn it.

If you can’t download and install QB64, you can program in QBasic at this online link after signing up:

Hope this helps and does not mislead or confuse you. If you are working with a version of BASIC that still uses line numbers, let me know, and I’ll find helpful materials and online links that uses it.

Similar questions