Assignments
Assignments
Program9: Get this output using simple loops. Here no of iterations are
important.
zyxwvwxyz
zyxwxyz
zyxyz
zyz
z
Program10: Using pointers write your own functions for the following:
a. String comparison
b. String concatenate
c. String copy
d. String length.
Note: Do not include <string.h> in your program
Program 11: Write a program that will read each line in a file and
store it
in another file with the sequence reversed, that is, the first
line in file one should be the last line in file two and so on.
Program12: Write a program to maintain a singly linked list having
the
following functions:
a. Creation of the list
a. Displaying the list.
b. Traverse through the linked list and pick all the
odd numbered nodes and place them in the
beginning of the list and the rest will be all the
even numbered nodes.
E.g. 25 15 18 7 26 11
Output: 25 18 26 15 7 11
Program13: Write a program to maintain a singly linked list having
the
following functions:
1. Creation of the list
2. Displaying the list.
3. Traverse through the linked list and add
contents of two consecutive nodes. The result
should be inserted soon after the nodes added.
E.g.: 5 15 8 9 2 6
Output: 5 15 20 8 9 17 2 6 8
Program 14: Write a program to cyclically permute a string one
character
at a time.
E.g.: If space is the input the output should produce
space
paces
acesp
cespa
espac
Program15: Get this output using simple loops. Here no of iterations
are
important.
0
101
21012
3210123
432101234
54321012345