Question: Write a C program that converts an uppercase character to a lowercase character. Declare function char toLower ( char ch ) ; to do the

Write a C program that converts an uppercase character to a lowercase character. Declare function
char toLower(char ch);
to do the conversion. If ch is not an uppercase character, the function should return ch unchanged. If it is an uppercase character, add the difference of 'a' and 'A' to ch as the return value. (a) Write your program with a global variable for the actual parameter. Translate your C program to Pep/9 assembly language.
The C code:
#include
char myChar;
char toLower(char ch){
if ((ch >=A) && (ch <=Z)){
return ch +a-A;
}
else {
return ch;
}
}
int main (){
scanf(%c, &myChar);
printf(%c
, toLower(myChar));
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!