0% found this document useful (0 votes)
11 views2 pages

C Programming Mock Assignment 4

This document provides instructions for two exercises involving functions and pointers in C programming. The first exercise asks the user to input a number and power and calls a function to calculate and return the result, repeating until a character is entered. The second exercise takes four letters as pointers, orders them from smallest to largest using a function, and displays the next letters in the alphabet for each in the main function.

Uploaded by

AnasChihab
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

C Programming Mock Assignment 4

This document provides instructions for two exercises involving functions and pointers in C programming. The first exercise asks the user to input a number and power and calls a function to calculate and return the result, repeating until a character is entered. The second exercise takes four letters as pointers, orders them from smallest to largest using a function, and displays the next letters in the alphabet for each in the main function.

Uploaded by

AnasChihab
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Mock Assignment 4 - C Programming/Functions and Pointers

Exercise 1
Write a C program that keeps asking the user for a number and a power and computes the result until the
user enters a character to stop the program. You should handle all possible cases for the number and the
power, and use the following function header: double Power(int N, int P).

Exercise 2
Write a C program that takes 4 letters from the alphabets, orders them from the smallest to the biggest and
display the next alphabets for each letter. Use the following function header:
void ManipulateAlphabets(char *C1, char *C2, char *C3, char *C4);
assume that all inputs are upper case, and you should print the next alphabets in the main function!
Do not handle any exceptions.
Example:
Enter your 4 alphabets: A Y K N
Alphabets ordered: A K N Y, and next alphabets are: B L O Z.

You might also like