Here the c program and op is below :
file : loops.c
#include<stdio.h>
int main() {
int a = 1; //defining variable
do{
a = a + 2;
}
while(a < 5); //looping encounters
print f("%d", a); // printing the value of a
}
output:
5
To be explain that :
The output to be expected is 3 4 ,but it showing the output is 5 can anyone explain this simple
code on c programming and the control flow of this program and how it works.
New contributor
Sudharsan J is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1