{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

T-5(3) - for(b=0;b<strlen(str;b...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<stdio.h> #include<conio.h> #include<string.h> void main (void) { char str[90],temp; int wd_count=0,ch_count=0,a,b; clrscr(); printf("Enter the string\n"); gets(str); for(a=0;str[a]!='\0';a++) { ch_count++; if(str[a]==' ') wd_count++;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } for(b=0;b<strlen(str);b++) for(a=0;a<strlen(str-1);a++) if(str[a+1]<str[a]) { temp=str[a+1]; str[a+1]=str[a]; str[a]=temp; } printf("ch count=%d\nword count=%d\n",ch_count,++wd_count); puts(str); getch(); }...
View Full Document

{[ snackBarMessage ]}