🔴 Class 64 : Program to find number of spaces and numbers in a String
// check for spaces and numbers in string
int main()
{
char str[20];
gets(str);
int i=0;
int count=0;
while(str[i]!='\0')
{
if(str[i]==' ')
{
count=count+1;
}
if(str[i] greater than symbol ‘0' && str[i] less than ‘9')
{
count=count+1;
}
i=i+1;
}
printf("Spaces & Numbers are = %d",count);
return 0;
}