Dr. A.P.J. Abdul Kalam Technical University (AKTU), Lucknow

Lab Exercise

41. Write the following C program using pointer.

a. To sort the list of numbers through pointer.

Sample Input and Output

Stdin Inputs:

5 6 9 5 7 2

Sample Result:

Input number of elements: 5
Input elements: 6 9 5 7 2
Array: 6 9 5 7 2
Sorted Array: 2 5 6 7 9

b. To reverse the string through pointer.

Sample Input and Output

Stdin Inputs:

www.digitalg1.com

Sample Result:

Input string: www.digitalg1.com
Reverse String: moc.1glatigid.www

Leave a Reply

Your email address will not be published.

Scroll to Top