To write: a program to check whether the given number is prime or composite.
Answer to Problem 3CE
Checks if the entered number is prime or composite.
Explanation of Solution
Concept used:Use different syntax that is used to PRINT, INPUT, FOR, IF…ELSE and does other operations while writing required BASIC program.
BASIC program to check if the given numbers are prime or composite:
10 CLC
20 INT
30 PRINT “Enter a positive integer
40 SET F=0;
50 FOR
60 IF
70 F=1;
80 BREAK;
90 ELSE
100 IF F==1
110 PRINT “
120 ELSE
130 PRINT “
140 RETURN 0;
150 END
Here line 30 prints message. Line 40 sets
Enter an integer:
Enter an integer:
Conclusion: Programs checks if the entered number is prime or composite.
Chapter 5 Solutions
Algebra: Structure And Method, Book 1
Additional Math Textbook Solutions
Introductory and Intermediate Algebra for College Students (5th Edition)
Linear Algebra with Applications (2-Download)
College Algebra (10th Edition)
Elementary and Intermediate Algebra
Intermediate Algebra (7th Edition)
Elementary Algebra
- Algebra and Trigonometry (6th Edition)AlgebraISBN:9780134463216Author:Robert F. BlitzerPublisher:PEARSONContemporary Abstract AlgebraAlgebraISBN:9781305657960Author:Joseph GallianPublisher:Cengage LearningLinear Algebra: A Modern IntroductionAlgebraISBN:9781285463247Author:David PoolePublisher:Cengage Learning
- Algebra And Trigonometry (11th Edition)AlgebraISBN:9780135163078Author:Michael SullivanPublisher:PEARSONIntroduction to Linear Algebra, Fifth EditionAlgebraISBN:9780980232776Author:Gilbert StrangPublisher:Wellesley-Cambridge PressCollege Algebra (Collegiate Math)AlgebraISBN:9780077836344Author:Julie Miller, Donna GerkenPublisher:McGraw-Hill Education