Write a program to accept a string from user and using pointers
Input:
Enter a string:
pointers
Output:
String in reverse order: sretniop
Length of the string: 8
Write a program to implement calculator as we had done in Assignment 2, using pointers. You need to write separate function for all the operations(+,-,*,/). In these functions you need to pass the variables as pointers and then perform the requested operation and return the result. To calculate the result you should not use a third variable.
For example: Consider the function int sum(int *a, int *b); Here, the addition of two numbers must be stored in a and returned.
Write a program to swap two numbers using pointers. You should write a function swap() where you pass two numbers and return the result to the call and print it there.
Input:
Enter two numbers:
a= 5
b=16
Output:
Numbers after swapping
a= 16
b= 5
Write a program in C to sort the elements of an array using pointers. The elements must be sorted in both ascending and descending order. You must write two different functions sortAscending() and sortDescending() to do the sorting.
Input:
Input array elements: 10 -1 0 4 2 100 15 20 24 -5
Output:
Array in ascending order: -5, -1, 0, 2, 4, 10, 15, 20, 24, 100
Array in descending order: 100, 24, 20, 15, 10, 4, 2, 0, -1, -5