Preview

Q Basic

Satisfactory Essays
Open Document
Open Document
627 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Q Basic
1) WAP to print the Fibonacci series
CLS
a = 1 b = 1
PRINT a, b,
FOR i = 1 TO 8 c = a + b
PRINT c, a = b b = c
NEXT i
END
……………………………………………………………………………….

2) WAP to print the factors of a given number
REM Program to print the factors of a given number
CLS
INPUT “Enter any number”; n
FOR i = 1 TO n
IF n MOD i = 0 THEN PRINT i,
NEXT i
END
…………………………………………………………………………………

3) WAP to print the greater among ten different numbers

REM Program to print greater number among ten different numbers
CLS
INPUT “Enter first number”; g
FOR i = 2 TO 10
INPUT “Enter next number”; a
IF a > g THEN g = a
NEXT
PRINT g; ” is the greatest number”
END
………………………………………………………………………………….
4) WAP to print the greater among three different numbers

REM Program to print greater among three different numbers
CLS
INPUT “Enter first number”; a
INPUT “Enter second number”; b
INPUT “Enter third number”; c
IF a > b AND a > c THEN
PRINT a; ” is greater”
ELSEIF b > a AND b > c THEN
PRINT b; ” is greater”
ELSE
PRINT c; ” is greater”
END IF
END
…………………………………………………………………………….

5) WAP to print the greater among two different numbers

REM Program to print the greater among two different numbers
CLS
INPUT “Enter first number”; a
INPUT “Enter second number”; b
IF a > b THEN
PRINT a; ” is greater”
ELSE
PRINT b; ” is greater”
END IF
END
………………………………………………………………………………..
6) WAP to calculate the cube root of a given number
REM Program to calculate the cube root of a given number
CLS
INPUT “Enter any number”; n c = n ^ (1 / 3)
PRINT “Cube root of “; n; ” is “; s
END
…………………………………………………………………………………..

7) WAP to calculate the square root of a given number

REM Program to calculate the square root of a given number
CLS
INPUT “Enter any number”; n s = SQR(n)
PRINT “Square root of “; n; ” is “; s
END
1)Program to check the given number for palindrome in qbasic using declare sub

DECLARE SUB A (N)
CLS
INPUT “ENTER A NUMBER”; N
CALL

You May Also Find These Documents Helpful

  • Good Essays

    Nvq Level 2

    • 1570 Words
    • 7 Pages

    The Public health (control of diseases) Act 1984 and the health and social care act, The NICE guidelines , Policies and procedures…

    • 1570 Words
    • 7 Pages
    Good Essays
  • Satisfactory Essays

    DISCLAIMER: This is NOT the only way to do this essay, don’t take any of this as gospel. We…

    • 757 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    nvq level 2

    • 337 Words
    • 2 Pages

    Usually disease can be contracted through air or fluids. Through human to human it is more often airborne than fluid borne.…

    • 337 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Dbq 2

    • 926 Words
    • 3 Pages

    The Mongol empire which lasted roughly One hundred and sixty-three years was an empire of nomadic people who were not as barbaric as other empires in their time thought they were. The Mongols ruled over the largest land than any other empire which shows that they were nomadic people which needed a mass amount of land to meet their needs. Their empire had strict laws and customs which come off very violent which led other civilizations to find them barbaric. Although they were nomads they were organized in warfare and even had a capital.…

    • 926 Words
    • 3 Pages
    Good Essays
  • Good Essays

    DBQ 2

    • 478 Words
    • 2 Pages

    During the period of 1801-1817, Democratic-Republicans and Federalists had different views of the Constitution; strict interpretation and then loose interpretation. Thomas Jefferson and James Madison were two Democratic-Republican presidents who viewed the Constitution strictly. However, Jefferson would sometimes adopt federalist practices and loosely interpret the Constitution. The federalists during the Hartford Convention viewed the Constitution super strictly; especially many objectives of the War of 1812 were unconstitutional. Throughout 1801-1817, Jefferson had both strict and loose interpretations of the Constitution, as did federalists.…

    • 478 Words
    • 2 Pages
    Good Essays
  • Good Essays

    DBQ: The Progressive Era

    • 785 Words
    • 4 Pages

    The progressive era directly followed the post-civil wartime of chaos and corruption. The United States of America desperately needed change. As a result of this desire for change a varied group called progressives (which were largely composed of white middle class), pushed to improve America’s current condition and created a set of goals. A majority of these goals were achieved pushing America to having increased social justice, corporation control, and regulations on consumer products. However not all hopes of change were granted and some failures still remained. The progressive era was a time of major reform and for the most part took strides of success towards its myriad of goals, which the U.S. desperately needed to achieve.…

    • 785 Words
    • 4 Pages
    Good Essays
  • Good Essays

    Dbq 5

    • 462 Words
    • 2 Pages

    In the time between 1830 and 1860 we see a great divide through America on the topic of slavery. Abolitionists were growing in number and starting to rally against the Pro-slave supporters of the south.…

    • 462 Words
    • 2 Pages
    Good Essays
  • Good Essays

    World War II In the 1930s, Japan, Germany and Italy wanted to extend their powers and began invading other countries. Even though the U.S. was in the “Isolationist” mode, President Franklin D. Roosevelt still extended his helping hands to Germany’s opponents. For example, he signed the Lend-Lease Act of 1941 which ended oil sales to Japan. America announced war on the Axis powers by declaring war on Japan first and then on Germany.…

    • 455 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    nvq level 2

    • 255 Words
    • 1 Page

    Lifestyle habits, for example not having a regular sleep routine, eating late at night, drinking excessive amounts of alcohol.…

    • 255 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Nvq Level 3

    • 445 Words
    • 2 Pages

    Sequence means that there is a definite pattern to a child developing e.g. a toddler being able to walk before they can run. Rate means the speed in which a child develops. The child develops when they achieve this by sequencing it enables us to plan effectively and at the right time. When recording the rate of development it helps us to identify any concerns that we may have within the development area, this enables you to further investigate why this is happening.…

    • 445 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    nvq level 2

    • 343 Words
    • 2 Pages

    Unit 4222-201 Introduction to communication of health and social care or children’s and young people’s setting (SH21)…

    • 343 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nvq Level 2

    • 347 Words
    • 2 Pages

    Personal hygiene is a topic often brought up during the pre-teen and teen years when a youngster's body is developing. However, there are times when adults need to be reminded about personal care as well. When subtle hints about showering or using deodorant have no effect, a conversation is the next step. This conversation can be uncomfortable for us and the resident but it doesn't need to be. With some preparation and a few helpful props, we can talk to someone about personal hygiene and help him implement improvements.…

    • 347 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nvq Level 2

    • 549 Words
    • 3 Pages

    Reflecting on practice is an important way to develop knowledge, skills and practice as helps make sense of and learn from experiences, develop skills and techniques, understanding what works and what doesn’t work, considering what could have been done differently.…

    • 549 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Apush Dbq 4

    • 969 Words
    • 4 Pages

    The American Revolution shocked the world; no one had ever expected a small group of colonies to fight for and win their own independence from the seemingly greatest and most omnipresent country on earth. Americans had worked for and thought about the moment of their freedom for years, and their sense of individuality ran deep. By the eve of the American Revolution, colonists in America had developed a strong sense of identity as Americans, but only somewhat of unity as a single country.…

    • 969 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Nvq Level 2

    • 6498 Words
    • 26 Pages

    2. People may want to communicate to share their ideas or to teach others for example if i were taking a new carer out shadowing I would want to communicate effectively so i know I have done my best to let them know what and how to do the job.…

    • 6498 Words
    • 26 Pages
    Powerful Essays