Anonymous user
Rosetta Code:Village Pump/: Difference between revisions
no edit summary
(basic question) |
No edit summary |
||
Line 1:
{{Vptopic
|topic=i have a doubt based on c loops programming (im beginner)
|summary= in do while loop why we assign (-1) to count in the below programming
}}
#include <stdio.h>
#include <ctype.h>
#define EOL '\n'
main()
{
char letter[80];
int tag, count =-1;
do ++count;
while ((letter[count]=getchar()) != EOL);
tag = count;
count=0;
do{
putchar(toupper(letter[count]));
++count;
}
while(count<tag);
}
in do while loop why we assign (-1) to count in the below programming.... could you assist me to overcome this problem..
|