Task 1
Write a C program that reads text (character data) from the
file. Words in the file are separated by white spaces. The
program shall find the length of each word and save the lengths
in an array
Example
Text.txt: 47 A QUICK 12345 JUMPS OVER 50012
21212 LAZY 11111
Original text: A QUICK JUMPS OVER LAZY
Array of Length: 15544
Task2
Write a program in C++ that reads data from a file (ask user to
enter file name). Separate even and odd numbers from data and
store them in separate arrays.
Example
Data.txt 14 23 15 1 82 8 9 10 21 55 12 14 16 18
Data:
2 3 15 1 82 8 9 10 21 55 12 14 16 18
Even-Numbers: 2 82 8 10 12 14 16 18
Odd-Numbers:
315 19 21 55
Answers
Answered by
1
Explanation:
21212 LAZY 11111
Original text: A QUICK JUMPS OVER LAZY
Array of Length: 15544
Task2
Write a program in C++ that reads data from a file (ask user to
enter file name). Separate even and odd numbers from data and
store them in separate arrays.
Example
Data.txt 14 23 15 1 82 8 9 10 21 55 12 14 16 18
Data:
2 3 15 1 82 8 9 10 21 55 12 14 16 18
Even-Numbers: 2 82 8 10 12 14 16 18
Odd-Numbers:
315 19 21
Similar questions
Accountancy,
2 months ago
Math,
2 months ago
Social Sciences,
5 months ago
Physics,
11 months ago
Business Studies,
11 months ago
English,
11 months ago