hi... Can any one help me about text justification("justification on both sides", or "double justification", where text lines are justified both on the left and on the right. That is, all lines except (usually) the last one have equal width; the method used to achieve that is typically to leave extra space between words as needed.).
Rules :
- Each line should start and end with an alphanumeric letter unless there is only one word in the line.
- Each line length should be equal to the user specified length.
- A word shouldn’t be broken into two parts.
- The white space should be distributed in a balanced way.
for example:
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void main() {
char sstr[] = " any text abouth 900 characters";
int twid;
int slen = 0;
slen = strlen(sstr); // Length of the input string
//printf("\nlen :%d\n", slen);
printf("Enter text width :");
scanf("%d",&twid);
//printf("\nText Width %d",twid);
//I need help!!!
}