226k views
1 vote
Write a qbasic program to supply first , middle and last name of a person and print the output as given below :

If input is Sam Christopher Robert output should be Robert Christopher Sam.​

User MarkA
by
4.4k points

1 Answer

3 votes

Answer:

The QBasic program is as follows:

10 INPUT "First name: " fName$

20 INPUT "Middle name: " mName$

30 INPUT "Last name: " lName$

40 PRINT lName$," ",mName$," ",fName$

50 END

Step-by-step explanation:

This prompts the user and gets input for first name

10 INPUT "First name: " fName$

This prompts the user and gets input for middle name

20 INPUT "Middle name: " mName$

This prompts the user and gets input for last name

30 INPUT "Last name: " lName$

This prints the output in the required format

40 PRINT lName$," ",mName$," ",fName$

This ends the program

50 END

User Thenewbie
by
5.1k points