Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Do-while loop in Arduino
The do-while loop’s syntax in Arduino is similar to the syntax in C. It is given below −
do{
//Code
} while (condition);
Note the semicolon at the end.
Example
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println();
int i = 5;
do{
Serial.println(i);
i--;
} while(i > 0);
}
void loop() {
// put your main code here, to run repeatedly:
}
Output
The Serial Monitor output is shown below −

Advertisements