Basic C Program

Cancelled Posted Apr 8, 2007 Paid on delivery
Cancelled Paid on delivery

Write a program to input and process a text string. The program should print out each word and its length contained in the input text string. The program should handle obvious cases such as punctuation, multiple white spaces between words and line feeds, and also allow any non-punctuation within a word (such as first-hand, EE2372, IBM-370).

## Deliverables

The output is as follows:

WORD SIZE

name 4

non-punctuation 15

.......

First run your program as usual by using the keyboard to input a few words. Then, use text editor to create a data file containing the third sentence of this assignment as input to test your program. Use the following unix commands to tun the program and print the results.

cat filename.c > results (copy source to file results)

cat filename.d >> results (append data file to results)

[login to view URL] < filename.d >>results (execute the program with input from data file and output to results)

This is what i've done for the first part as far as typing the input text string. It works but not if you have spaces between words or anything. Don't know how to include the data file to work with this.

#include <stdio.h>

#include <string.h>

main()

{

int c;

char string[81];

scanf("%s", string);

printf("WORD\t\tSIZE\n");

printf("%-15s %d\n", string, strlen(string));

}

## Platform

needs to run on UNIX and/or LINUX.

C Programming Engineering MySQL PHP Project Management Software Architecture Software Testing

Project ID: #2915423

About the project

5 proposals Remote project Active Apr 9, 2007

5 freelancers are bidding on average $23 for this job

philippvw

See private message.

$55.25 USD in 14 days
(42 Reviews)
5.7
macspainvw

See private message.

$25.5 USD in 14 days
(2 Reviews)
1.4
jbastow

See private message.

$12.75 USD in 14 days
(2 Reviews)
1.1
egatesvw

See private message.

$8.5 USD in 14 days
(0 Reviews)
0.0
sean0101a

See private message.

$15.3 USD in 14 days
(0 Reviews)
0.0