REM A equals 5 END Print all let equals 7?
...when you RUN the above QBASIC program by pressing function key [F5]; then, the Output Screen will display the following...
Press any key to continue...
In other words, a totally 'blank screen' will be shown; followed by the usual 'Press any key to continue...' message; pressing any key will return you straight back to the Editor Screen; where you can continue writing code.
Also, see FOOTNOTE(2) below.
====
FOOTNOTE(2): CONCERNING THIS PARTICULAR LINE OF QBASIC CODE
REM A equals 5 END Print all let equals 7?
Even if we were take away the REM statement from this line of code; in order to make that code executable. We would get nothing but ERROR MESSAGES! Because this is NOT correct QBASIC code!
A equals 5
...is wrong! There is no 'equals' statement in QBASIC; instead, the line should have said...
A=5
...where = is the assignment symbol/read the = sign as saying 'becomes the value of'...so, A becomes the value of 5.
END
...is correct QBASIC code; but, that would also mean the program ends here. So, whatever lines following this END statement would NOT get executed!
Print all
...is more nonsense; first PRINT which is a valid QBASIC statement; should have been written using all capital letters. Second, QBASIC code doesn't have an 'all' statement. Unless you were using 'all' as a variable name; in which case the output would simply show as, nil; that is, if you haven't already assiged the 'all' variable name a value. So, if all is an unintialised variable name then the value printed out would be....
0
let equals 7
...more nonsense, again, I'm afraid! LET, written using capital letters, is a correct QBASIC statement; but, it's meant to be followed by a variable name; and, in this case there's none; unless 'equals' is meant to be a variable name. Then, the code should have been written as...
LET equals = 7
Even when I've gone and corrected the code to say the following...
A=5
END
PRINT all
LET equals = 7
...still doesn't make any sense?! The program would silently execute the first line; then, immediately, stop...when it gets to reach the second line END statement; there would be no output being shown at all; only a blank screen. Plus, all other lines of code...after the END statement...would be completely ignored.
Frankly, I don't understand this line of code at all?! I think, it's written out entirely wrong; probably, that's exactly why it's been deliberately commented out using REM.
The program you've provided appears to be written in a BASIC-like syntax. The REM statement is a comment and does not affect the execution, so "A equals 5" is ignored. The print ali let equals 7 seems to be malformed; it should likely be split into separate statements for proper execution, such as PRINT ali and LET A = 7. As it stands, the program will likely result in a syntax error.
Here is a simple FORTRAN code to calculate the factorial of a given non-negative integer: program factorial implicit none integer :: n, result print *, "Enter a non-negative integer:" read *, n result = 1 if (n < 0) then print *, "Factorial is not defined for negative numbers." else do i = 1, n result = result * i end do print *, "Factorial of", n, "is", result end if end program factorial This program prompts the user for an integer, checks if it's non-negative, and then calculates the factorial using a loop.
10 print "That is not a question." 20 print "That is a command." 30 end
cls input "enter a no"; num if num mod 14= num then print "no is divisible" else print "not divisible" end if end
vowels$ = "aeiou" CLS PRINT "PROGRAM: Find if letter is a vowel or not" PRINT INPUT "Type a single alphabet letter: (a-z)/and, then, press Enter key"; aLetter$ PRINT PRINT "Letter "; aLetter$; IF INSTR(vowels$, LCASE$(aLetter$)) THEN PRINT " is a vowel." ELSE PRINT " is NOT a vowel." END
Starts Input a,b Result=(a-b)*(a-b) Print"square of difference=",result
The result is 7.
Cls print the multiples tables of 1 to 5 for x=1 to 5 for y=1 to 10 print x;"*";y;"=";x*y next y print print next x end
(Uses Square Root Function) PRINT "Ax^2 + Bx + C = 0" INPUT "A = ", A INPUT "B = ", B INPUT "C = ", C D = B * B - 4 * A * C IF D > 0 THEN DS = SQR(D) PRINT "REAL ROOTS:", (-B - D) / (2 * A), (-B + D) / (2 * A) ELSE IF D = 0 THEN PRINT "DUPLICATE ROOT:", (-B) / (2 * A) ELSE DS = SQR(-D) PRINT "COMPLEX CONJUGATE ROOTS:", (-B / (2 * A)); "+/-"; DS / (2 * A); "i" END IF END IF
====== FOR tablesNo%=1 TO 12 CLS PRINT "PROGRAM: "; tablesNo%; "X Tables:-" PRINT FOR timesNo%=1 TO 12 PRINT timesNo%; " X "; tablesNo%; " = "; timesNo%*tablesNo% NEXT PRINT PRINT "Press [SPACEBAR] key to continue..." SLEEP NEXT END
enterNumber computeNumber multiply by ten print the results end program
==== '----------------------------------------------- '*** PROGRAM: Main Menu ' LANGUAGE: QBASIC: VERSION: QB64 '----------------------------------------------- '------------------------------------------ '*** Global variable declarations list... '------------------------------------------ userKeyPress$="" '----------------------- '*** Main Program... '----------------------- DO 'this is a menu driven program... GOSUB clearScreen GOSUB printMainMenuTitleHeading GOSUB printMainMenuOptionsList GOSUB printMainMenuInstructionsHeading GOSUB printMainMenuUserInstructions GOSUB awaitUserKeyPress GOSUB checkUserKeyPress LOOP UNTIL UCASE$(userKeyPress$) = "Q" '...UCASE converts lower case to upper END '...END of program/halt program code execution '---------------------- '*** Sub-routines... '---------------------- clearScreen: CLS '...(CL)ear the output (S)creen RETURN printMainMenuTitleHeading: PRINT "MAIN MENU" PRINT "========" RETURN printMainMenuOptionsList: PRINT "Hit key: <1> for Program 1: 12 X Tables Square" PRINT "Hit key: <2> for Program 2: Select a times tables to print out" PRINT PRINT "Hit key: <Q> to Quit!" PRINT RETURN printMainMenuInstructionsHeading: PRINT "USER INSTRUCTIONS" PRINT "==============" RETURN printMainMenuUserInstructions: PRINT "In order to select from the above Main Menu options list..." PRINT PRINT "First, chose the type of program you wish to run..." PRINT "by, carefully, reading it's description." PRINT PRINT "Then, hit a corresponding single number/letter key, either: '1'/'2';" PRINT "or, alternatively, hit key: 'Q' to Quit!" PRINT PRINT "-Thank you!" RETURN awaitUserKeyPress: DO '...keep looping until when user presses any key... userKeyPress$ = INKEY$ '...store any IN-coming KEY press LOOP UNTIL userKeyPress$ <> "" RETURN checkUserKeyPress: IF userKeyPress$ = "1" THEN GOSUB program1 '...GO to named SUB-routine IF userKeyPress$ = "2" THEN GOSUB program2 '...GO to named SUB-routine RETURN program1: GOSUB clearScreen PRINT "PROGRAM 1" '(...program 1/code goes here...) GOSUB awaitUserKeyPress RETURN program2: GOSUB clearScreen PRINT "PROGRAM 2" '(...program 2/code goes here...) GOSUB awaitUserKeyPress RETURN