Basic C Program

Dibatalkan Dipasang Apr 8, 2007 Dibayar saat pengiriman
Dibatalkan Dibayar saat pengiriman

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.

Pemrograman C Teknik MySQL PHP Manajemen Proyek Perancangan Perangkat Lunak Pengujian Perangkat Lunak

ID Proyek: #2915423

Tentang proyek

5 proposal Proyek online Aktif Apr 9, 2007

5 freelancer rata-rata menawar $23 untuk pekerjaan ini

philippvw

See private message.

$55.25 USD dalam 14 hari
(42 Ulasan)
5.7
macspainvw

See private message.

$25.5 USD dalam 14 hari
(2 Ulasan)
1.4
jbastow

See private message.

$12.75 USD dalam 14 hari
(2 Ulasan)
1.1
egatesvw

See private message.

$8.5 USD dalam 14 hari
(0 Ulasan)
0.0
sean0101a

See private message.

$15.3 USD dalam 14 hari
(0 Ulasan)
0.0