Showing posts with label Word. Show all posts
Showing posts with label Word. Show all posts

C Program to Reverse a Word

How to write a C Program to Reverse a Word in C Programming Language ?

This program reverse a word.

Solution For C Program:

Dictionary Word Search C Program

How to write a C Program to Find Dictionary Word Search ?


Solution For C Program to Find a Word in Dictionary :

C Program To Input & Print More Than One Words In Single Line

How to write a C Program To Input & Print More Than One Words In Single Line in C Programming Language ?


Solution For C Program :

/*C Program To Input & Print More Than One Words In Single Line.*/

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char s1[50];
int len;
clrscr();
printf("\nEnter the string:");
scanf("%[^\n]",s1);
printf("Output string:%-50s",s1);
len=strlen(s1);
printf("\nlength of the string =%d",len);
getch();
}

You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable

C Program to count number of sentences words and letters in a paragraph

How to write a C Program to count number of sentences words and letters in a paragraph in C Programming Language ?

This C Program to count number of sentences words and letters in a paragraph.

Solution:

  1. #include<stdio.h>
  2. main()
  3. {
  4.         char ch[150];
  5.         int i,c=0,c1=0,c2=0;
  6.         printf("Enter a Paragraph \n");
  7.         gets(ch);
  8.         for(i=0;ch[i]!='\0';i++)
  9.         {
  10.                 if(ch[i]=='.'||ch[i]=='!'||ch[i]=='?')
  11.                 {       c++;
  12.                         c1++;
  13.                 }
  14.                 else if(ch[i]==' '||ch[i]==',')
  15.                         c1++;
  16.                 else if(ch[i]>65&&ch[i]<123)
  17.                         c2++;
  18.         }
  19.         printf("\nNumber of letters = %d \nNumber of words=%d ",c2,c1);
  20.         printf("\nNumber of Sentences = %d\n",c);
  21. }