#include<stdio.h>
main()
{
int i,count;
char string[100];
i=0;
count=0;
printf("Enter a sentence :- ");
gets(string);
while(string[i]!='\0')
{
if(string[i]!=' ')
{count++;}
i=i+1;
}
printf("%d characters excluding spaces",count);
}
main()
{
int i,count;
char string[100];
i=0;
count=0;
printf("Enter a sentence :- ");
gets(string);
while(string[i]!='\0')
{
if(string[i]!=' ')
{count++;}
i=i+1;
}
printf("%d characters excluding spaces",count);
}
0 Comments