A Comparative Analysis of Looping Structures: Comparison of ‘While’ Loop and ‘Do-While’ Loop in the C++ Language

  • Shouthiri P
  • Thushika N
N/ACitations
Citations of this article
43Readers
Mendeley users who have this article in their library.

Abstract

Looping is one of the fundamental logical instructions used for repeating a block of statements. All programming languages are used looping structures to simplify the programs. Loops are supported by all modern programming languages, though their implementations and syntax may differ. This paper compares the two types of looping structures while and do-while using the compile time and runtime of the given programs to improve the efficiency of the programs. It is found that for small number of iterations while is efficient in runtime and do-while is efficient in compile time, the difference in total execution time may not be considerable. But given any large number of iterations, the difference is noticeable.

Cite

CITATION STYLE

APA

Shouthiri, P., & Thushika, N. (2019). A Comparative Analysis of Looping Structures: Comparison of ‘While’ Loop and ‘Do-While’ Loop in the C++ Language. Asian Journal of Research in Computer Science, 1–5. https://doi.org/10.9734/ajrcos/2018/v2i328752

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free