Q1) Answer the questions for the following flowchart 1. Write an algorithm 2. Write a C program 3. Write the output, if n = 5. START x= 5, y=3, i = 1 Read n is i<=n NO STOP YES Write i*x, i*y i = i + 1 (2 marks) (2 marks) (1 marks)
Added by John M.
Close
Step 1
Algorithm: - Read the value of n. - If n is equal to YES, then write "x". - If n is equal to NO, then calculate 1+1 and write the result. - Stop. Show more…
Show all steps
Your feedback will help us improve your experience
Tanvi Garg and 89 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Q3: Create a flowchart and pseudocode to find the factorial of a number n (n! = 1x2x3x...n). Example: 5! = 1x2x3x4x5 = 120
Supreeta N.
Write a program that use loops to print the following patterns separately, one below the other. In your code use for, while and do-while loops to generate the patterns, use one loop for each question. [5 marks] 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 * ** *** **** *****
Sachchidanand P.
A. Write a program 1. Prompt the user to enter a positive integer n and read in the input: 2. Print out a right triangle of size n Xn made up of *. Sample: positive integer: 5 Write a program Prompt the user to enter a positive integer n and read in the input: 2. Print one Z shape of size n Xn: Sample: positive integer:
Shelayah R.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD