Monday, 7 March 2022

Practical No.10 Write a program that takes a number and prints its multiples up to 10.

ACTIVITY 10

Practical No.10:
Write a program that takes a number and prints its multiples up to 10.





OR

By Sir Sajjad Akber Chandio


ALGORITHM

  • step 1: start
  • step 2: Declare variables for loop and number
  • step 3: Input any number
  • step 4: Print multiples of number up to 10
  • step 5: Repeat step 4 10times (using for loop)
  • step 6: End


VIVA VOCE
ACTIVITY 10

Q.1: What is loop?
Ans: Iteration or loop in computer programming, is a process wherein a set of instructions or structures are repeated in a sequence a specified number of times until a condition is true.

Q.2: How many types of loops are there?
Ans: C++ provides the following types of loops to handle looping requirements.
1. for loop
2. while loop
3. do-while loop

Q.3: Define for loop.
Ans: A for loop is a repetition or iteration control structure that repeats a statement or block of statements for a specified number of times. The for loop is commonly used when the number of iterations is known.

Q.4: Which function is used for printing output?
Ans: tout is the most common input function in C++ used as output function.

Q.5: What are the Escape sequences in C++?
Ans: Escape sequence is a set of characters that convey a special meaning to the program.


No comments:

Post a Comment