write a algorithm to display first ten natural number
Answers
Answered by
4
* Algorithm For print "n" numbers */
1. Read the value of n.
2. i = 1
3. if ( i > n ) go to step 7
4. Display value of i
5. i = i + 1
6. go to step 3
7. Stop
/* Algorithm For print "n even" numbers */
1. Read the value of n.
2. i = 2
3. if ( i > n ) go to step 7
4. Display value of i
5. i = i +2
6. go to step 3
7. Stop
/* Algorithm For print "n odd" numbers */
1. Read the value of n.
2. i = 1
3. if ( i > n ) go to step 7
4. Display value of i
5. i = (2n - 1)
6. go to step 3
7. Stop
now you can calculate yourself
1. Read the value of n.
2. i = 1
3. if ( i > n ) go to step 7
4. Display value of i
5. i = i + 1
6. go to step 3
7. Stop
/* Algorithm For print "n even" numbers */
1. Read the value of n.
2. i = 2
3. if ( i > n ) go to step 7
4. Display value of i
5. i = i +2
6. go to step 3
7. Stop
/* Algorithm For print "n odd" numbers */
1. Read the value of n.
2. i = 1
3. if ( i > n ) go to step 7
4. Display value of i
5. i = (2n - 1)
6. go to step 3
7. Stop
now you can calculate yourself
Answered by
0
Answer: To print the first ten natural numbers
Explanation: Algorithm Step 1 : Start Step 2 : Input N Step 3 : Counter =1 Step 4 : Is counter `<=10´ Step 5 : Print C Step 6 : Counter = Counter + 1 Step 7 : Stop
Similar questions
English,
7 months ago
Hindi,
7 months ago
Social Sciences,
1 year ago
History,
1 year ago
Math,
1 year ago