Code:
#include<stdio.h>
void num(char arr[100])
{
int i=0, count=1;
while (arr[i]!='\0')
{
if (arr[i]==' ')
{count++;}
i++;
}
printf("%d",count);
}
int main()
{
char data [100];
scanf("%s",&data);
printf("%s",data);
num(data);
return 0;
}
in the printf in the main it will printf programming only and remove the rest
Comment