Professional Documents
Culture Documents
#include <stdio.h>
#define MAX_GRADES 10
int main()
{
int index;
float entered_value;
unsigned int nr_grades;
float total = 0.0;
int nr_passed_students = 0;
float average;
nr_grades = index;
return 0;
}
a) Describe the four functional parts within the given source code.
First determine the arguments and the return type of each function.
Choose meaningful names for the functions and the arguments.
Important: In the new program, the already existing global array should
not been changed and also not any additional global variables should be
used.
c) Write the main function of the new program calling the new functions.
2. Write a program that finds the position of the most significant bit set to 1
in an unsigned integer.
3. Write a function that swaps the values of two variables of the type int.
The function has two arguments to pass the addresses of the variables
(pass by reference).
Show the function call to swap the values of the following integer
variables:
int x = 1;
int y = 2;
Write a program that converts all the letters of this string to uppercase.
Make your program generic such that it can handle other text in the
string, containing other characters and of different sizes.