Class 6 Exam  >  Class 6 Questions  >  Given below is a QBASIC program which is not ... Start Learning for Free
Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:
10 PRINT “Enter a number, zero to stop:;
20 input A
30 IF A THEN GOTO 70
40 LET A = A + 10
50 PRINT “The number plus 10 is”, A
60 GOTO 10
70 STOP
  • a)
    The error is on the line 10.
  • b)
    The error is on the line 30.
  • c)
    The error is on the line 50.
  • d)
    There are no errors. 
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
Given below is a QBASIC program which is not printing any value. Find ...

The error in the given QBASIC program is on line 30. The correct syntax for the IF statement in QBASIC is "IF condition THEN statement". However, in this program, the condition is missing after the IF statement.
To fix the error, the program should be modified as follows:
10 PRINT "Enter a number, zero to stop:";
20 INPUT A
30 IF A < /> 0 THEN GOTO 70
40 LET A = A + 10
50 PRINT "The number plus 10 is", A
60 GOTO 10
70 STOP
Explanation:
- Line 10: Displays the message "Enter a number, zero to stop:".
- Line 20: Takes input from the user and stores it in variable A.
- Line 30: Checks if A is not equal to zero. If true, it jumps to line 70. This condition is necessary to stop the program when the user enters zero.
- Line 40: Adds 10 to the value of A.
- Line 50: Prints the message "The number plus 10 is" followed by the value of A.
- Line 60: Jumps to line 10 to repeat the process.
- Line 70: Stops the execution of the program.
Therefore, the corrected program will print the value of A plus 10 when A is not equal to zero.
Free Test
Community Answer
Given below is a QBASIC program which is not printing any value. Find ...
Error in Line 30:
The error in the given QBASIC program is on line 30. Here's why:
- The program prompts the user to enter a number in line 10.
- In line 20, the program takes the input and stores it in variable A.
- The error occurs in line 30, where the program checks if A is non-zero using the IF statement. However, the correct syntax for checking if a variable is non-zero in QBASIC is `IF A < /> 0 THEN`. In the current code, the condition `IF A THEN` is incorrect and will not work as intended.
- Due to this error, the program does not execute the subsequent lines of code properly and does not print any value.
To fix the error, line 30 should be updated to `IF A < /> 0 THEN GOTO 70`. This change will ensure that the program correctly evaluates if A is non-zero and proceeds accordingly.
Attention Class 6 Students!
To make sure you are not studying endlessly, EduRev has designed Class 6 study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Class 6.
Explore Courses for Class 6 exam

Top Courses for Class 6

Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer?
Question Description
Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? for Class 6 2024 is part of Class 6 preparation. The Question and answers have been prepared according to the Class 6 exam syllabus. Information about Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? covers all topics & solutions for Class 6 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer?.
Solutions for Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Class 6. Download more important topics, notes, lectures and mock test series for Class 6 Exam by signing up for free.
Here you can find the meaning of Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer?, a detailed solution for Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? has been provided alongside types of Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Given below is a QBASIC program which is not printing any value. Find the error in the given QBASIC program:10 PRINT “Enter a number, zero to stop:;20 input A30 IF A THEN GOTO 7040 LET A = A + 1050 PRINT “The number plus 10 is”, A60 GOTO 1070 STOPa)The error is on the line 10.b)The error is on the line 30.c)The error is on the line 50.d)There are no errors.Correct answer is option 'B'. Can you explain this answer? tests, examples and also practice Class 6 tests.
Explore Courses for Class 6 exam

Top Courses for Class 6

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev