Repetition C Programming

  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Repetition C Programming as PDF for free.

More details

  • Words: 130
  • Pages: 2
Repetition 1. Define and explain briefly on pretest loop and a post-test loop using the flowchart. 2. Compare a pretest loop and post-test loop. 3. Determine the output for the below program segments without using C compiler. a. i. y = 8; while (y>7) { printf (“%d\n”, y); } ii. for (int k = 10; k > 8;) { printf (“%d\n”, k); }

iii. z = 3; do { printf (“%d\n”, z); } while (z<9);

b. Rewrite the missing “loop update” in the above program segments.

4. Write a program to produce the below output: *+*+*+*+*+ *+*+*+*+ *+*+*+ *+*+ *+ 5. Write a program to produce the below output: ^*********

^^******** ^^^******* ^^^^****** ^^^^^***** ^^^^^^**** ^^^^^^^*** ^^^^^^^^** ^^^^^^^^^* ^^^^^^^^^^

Discussion: What will happen if C does not have repetition statement?

Related Documents

Repetition In C: Loops
November 2019 25
C Programming
November 2019 23
C Programming
July 2020 6
C Programming
June 2020 7
C Programming
October 2019 23