I'm writing code that prints the numbers 1 though 9 (Including 9). This is the code I have:
#include "stdio.h"
void main()
{
int count;
count = 1;
{
do
(count = count + 1);
while
(count < 10);
printf("%d", count);
printf("\n");
}
}
However when I run this it is not printing the numbers 1 through 9, its only printing out the number 10. Can someone please help me? I really don't know what I'm doing wrong and I am unfamiliar with how to use do ...while loops in c.
Question
Terabojin
Hello everyone!
I'm writing code that prints the numbers 1 though 9 (Including 9). This is the code I have:
However when I run this it is not printing the numbers 1 through 9, its only printing out the number 10. Can someone please help me? I really don't know what I'm doing wrong and I am unfamiliar with how to use do ...while loops in c.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts