c programming questions

timer Asked: Oct 17th, 2014

Question description

Task 1
Write a program that reads two strings from the command line. The user
should have the possibility of:
a) Concatenating the two strings 
NOTE: Use strcat from the C library.
b) Comparing two strings. 
Implement your own strcmp function.
NOTE: It is not allowed to use any function from the C string library.

Task 2
Write a program that fills a 3x3 matrix with random numbers containing the
values from 0 to 9. The program should print the generated matrix.
Furthermore, the user should have the possibility to replace a certain number
inside the matrix. For example, if the user enters number two then all
elements having the value two are replaced by a second entered number.
In addition the program should print out all the positions of the elements that
have been replaced.
The program should have a function for
- the initialization of a matrix
- printing a matrix
- replacing the number(s) inside the matrix
NOTE: The declared arrays should not be global.

Task 3
Write a program that has a structure called person with three member
variables (name, age and a customer ID number). Reserve memory for three
persons by using the malloc function. The program asks the user to enter the
data for three persons. After all data have been entered the program saves
the entered data in a text file.
NOTE: Use the gets(….), or fgets(…) function to read the input of the user

Studypool has helped 1,244,100 students
flag Report DMCA
Similar Questions
Hot Questions
Related Tags

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors