#include <stdio.h>
cant figure it out, im trying to count all digits
please help with this bugs
int main()
{
int iochar, numdigits=0, numlower=0, numupper=0, numwhites=0;
printf("Please enter a phrase:\n\n");
while((iochar=getchar())!=EOF)
{
if ((iochar='\o ')||(iochar='\t')||(iochar='\n'))
{
numwhites++;
putchar(iochar);
}
else
if((iochar>='0')&&(iochar<='9'))
{
numdigits++;
putchar(iochar);
}
else
if(('a'<=iochar)&&(iochar<='z'))
{
numlower++;
putchar(iochar-32);
}
else
if(('A'<=iochar)&&(iochar<='Z'))
{
numupper++;
putchar(iochar);
}
else
putchar(iochar);
}
printf("%d white characters, %d digits, ",numwhites,numdigits);
printf("%d lowercase have been converted to ",numlower);
printf("uppercase and %d uppercase.\n",numupper);
printf("\n\n");
return 0;
}
alex1050 -4 Newbie Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
Arbus 25 Practically a Master Poster
alex1050 -4 Newbie Poster
Arbus 25 Practically a Master Poster
alex1050 -4 Newbie Poster
Arbus 25 Practically a Master Poster
alex1050 -4 Newbie Poster
Arbus 25 Practically a Master Poster
alex1050 -4 Newbie Poster
alex1050 -4 Newbie Poster
Lerner 582 Nearly a Posting Maven
alex1050 -4 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.