In this loop, the body is executed at least once as the condition is tested at the end.
Syntax:
Initialization do { ..... ..... incrementation }while (condition)
Example:
To print the first 10 multiples of 5
#include<stdio.h> void main() { int a, i; a = 5; i = 1; do { printf("%d\t", a*i); i++; } while(i <= 10); }
Relevant Posts:
Categories: C Language
Leave a Reply