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)
|topic=binary digits
|summary= in do while loop why we assign (-1) to count in the below programming
|summary=easy - I seek if an existing task covers returning the bit count for/from the unicode of a string. Thanks ...--[[User:Billymac00|Billymac00]] ([[User talk:Billymac00|talk]]) 17:08, 19 January 2014 (UTC)
}}
#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..
Anonymous user