To browse Academia.edu and the wider internet faster and more securely, please take a few seconds to upgrade your browser.By using our site, you agree to our collection of information through the use of cookies.
Sample Qbasic Programs Free Account ToTaye Fredrick Download with Google Download with Facebook or create a free account to download THE PROGRAMMING KNOW-HOW USING QBASIC PROGRAMMING TECHNIQUES Download THE PROGRAMMING KNOW-HOW USING QBASIC PROGRAMMING TECHNIQUES F.Taye Fredrick Loading Preview Sorry, preview is currently unavailable.
Sample Qbasic Programs Upgrade Your Browser![]() And C is the variable where we will save the result in Celsius. In this article, we will see some QBasic programming examples and some simple exercises to understand how it works. These Qbasic program examples are a beginner-level, which mostly will help you to understand the concept of a variable and some basic qbasic statements like PRINT, INPUT, CLS etc. ![]() Before getting started it is important to know the basic Qbasic statements or QBasic commands first. Sample Qbasic Programs Code Some SimpleIf you have not read about it, check: QBasic Commands and Statements-2020 Here, we will code some simple examples which are easy to understand for class 6 class 7 students, who have started with QBasic programming. Here, the program codes are explained with there formulas to help you understand better. Page Contents Example of some Qbasic Programming Examples and Exercises Write a QBasic program to enter your name and print it. Write a qbasic program to enter your name, city, country, age and print them. Write a program to find out the simple Interest and the Amount. Write a QBasic program to convert temperature from Fahrenheit to Celsius Write a QBasic program to convert temperature from Celsius to Fahrenheit FAQ How do you convert Celsius to Fahrenheit in Qbasic How do you convert Fahrenheit to Celsius in Qbasic Example of some Qbasic Programming Examples and Exercises EXAMPLE 1: Write a QBasic program to enter your name and print it. CLS INPUT Enter your name;n PRINT The name is;n END Here since the input data is a string then the variable name ( n ) in which it is to be stored is written after INPUT command followed by sign( n ). EXAMPLE 2: Write a qbasic program to enter your name, city, country, age and print them. CLS INPUT Enter the name;N INPUT Enter the city;C INPUT Enter the country;CO INPUT Enter the age;A PRINT The name is;N PRINT The city is;C PRINT The country is;CO PRINT The age is;A END Here name, city, country are string so its variable name is written with sign before it and since age is a number so the variable name is written directly. ![]() CLS INPUT Enter the length;l INPUT Enter the breadth;b LET A lb PRINT The area of rectangle;a END Example 4: Write a program to find the area of the triangle. Here in this program we that variable b as base and h as height. CLS INPUT Enter the base;b INPUT Enter the height;h LET T 12bh PRINT The area of triangle;T END Example 5: Write a program to find the area of the circle. CLS INPUT Enter the radius;R LET C227R2 PRINT The area of circle;C END Example 6: Write a program to find the area of the square. CLS INPUT Enter the number;n LET square n2 PRINT The area of square;Square END Example 7: Write a program to find the volume of the box. The variable are l, b, and h for length, breadth and height and the result will be stored in the variable volume. CLS INPUT Enter the length;l INPUT Enter the breadth;b INPUT Enter the height;h LET volume lbh PRINT The volume of box;volume END Example 8: Write a program to find the circumference of the circle. FORMULA: circumference 227 x Radius x 2 CLS INPUT Enter the radius; R LET Circumference227R2 PRINT The area of circle; Circumference END Example 9: Write a program to find out the Simple Interest. FORMULA: Simple Interest Principle x Rate x Time 100 CLS INPUT Enter the Principal;P INPUT Enter the Rate;R INPUT Enter the Time;T LET I PTR100 PRINT The simple Interest;I END Example 10: Write a program to find out the simple Interest and the Amount. FORMULA: Simple Interest Principle x Rate x Time 100 Amount Principle Simple Interest CLS INPUT Enter the Principal;P INPUT Enter the Rate;R INPUT Enter the Time;T LET I PTR100 LET A P I PRINT The simple Interest;I PRINT The amount;A END Example 11: Write a QBasic program to convert temperature from Fahrenheit to Celsius Formula (Convert Fahrenheit to Celsius): C (F 32) (5 9) Here F is the variable that will store the INPUT value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |