این برنامه از ورودی داده ها را دریافت می کند.پایان ورودی با " . " است.
خروجی تعداد کلمات جمله ورودی می باشد.
برای مشاهده سورس به ادامه مطلب مراجعه نمایید...
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
clrscr();
char ch;
short int word=0;
printf("\n\n\tEnter a String:end by '.'\n\t");
ch=getche();
while(ch != '.')
{
if(ch== ' ')
word++;
ch=getche();
}
word++;
printf("\n\ttedad kalamat= %d", word);
getch();
}