Q1.A. Write a function toCapital() in ‘C’ to
RETURN A STRING IN CAPITALS
Prototype : void toCapital(char *);
B. Use the above function to convert a file into
capitals. File names should be passed at the command line.
`Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
void toCapital(char* s)
{
int i=0;
for(i=0;i<strlen(s);i++)
{
if(s[i]>='a'&&s[i]<='z')
{
s[i]=s[i]-'a'+'A';
}
}
}
Note: Brother according to HomeworkLib's policy we are only allowed to answer first part if there are many. So, I request you to post other part as separate posts.
Kindly revert for any queries
Thanks.
Q1.A. Write a function toCapital() in ‘C’ to RETURN A STRING IN CAPITALS Prototype : void...
Write in C language
5. [8] Write a function with prototype » void string_copy(const char source[], char destination[], int n); This function copies string source to string destination. Parameter n represents the size of array destination. If the latter array is not sufficiently large to hold the whole source string then only the prefix of the string which has room in the latter array should be copied. Note that after copying, the null character should also be included to mark...
C-programming In activity 1, a function will accept an input string composed of a command and a parameter. The function will extract the command and convert the parameter into an integer. The conversion of the string to an integer can be done using atoi()- alphanumeric to integer. stdlib.h needs to be included. Note that the parameter characters, e.g., “10”, need to be extracted from the input string, assign to an array, and fed to atoi(). Write a function that accepts...
1 (continued) b. (20 points) Complete the function with the prototype and description below. void removeNonLetters (char estr); This function should remove all characters in string str except letters. Remember that, since the string is passed by address, changes made to str inside the function are seen outside the function. For example, if the string 1. ERCE.2160 Fall 2019" before calling this function, then after calling removeNonLetters (1). 51 - "EECEFall". Hint: to access part of a string (a substring)...
4. [8] Write a C function with prototype void letter_freq(const char wordll, int freaq ); This function computes the number of appearances of each letter in the string word and stores them irn array freq of size 26. The letters are the 26 letters of the Latin alphabet whose ASCII values are in the range 97-122 for the lower case letters, and in the range 65-90 for the uppercase letters. You must account for uppercase and lowercase letter variants, which...
Need help problem 9-13
C++ Homework please help
WRITE FUNCTION PROTOTYPES for the following functions. The functions are described below on page 2. (Just write the prototypes) When necessary, use the variables declared below in maino. mm 1.) showMenu m2.) getChoice 3.) calcResult m.) showResult 5.) getInfo mm.) showName 7.) calcSquare 8.) ispositive int main { USE THESE VARIABLES, when needed, to write function prototypes (#1 - #8) double num1 = 1.5; double num2 = 2.5; char choice; double result;...
Part1. Write a C program contains the following declarations: char customer_name[N_CUSTOMERS][MAX_NAME_LENGTH]; int customer_number[N_CUSTOMERS] A program uses a text file that contains the following data on each line: The customer number is an int, and the first and last names are alphabetic strings that contain no whitespace. The last and first names themselves are however separated by whitespace. Write a C function with the following prototype: void read_customer (char name[][MAX_NAME_LENGTH], int number[], int position, FILE *cust_file) Your function should read a...
C program help 4. Write a function called scan_hex. Here is its prototype: void scan_hex(int *xptr); Here is an example of its use, in conjunction with print_decimal. Assume that the user will type a non-negative hex number as input. Also, assume that the “digits” a-f are in lower case. Let’s say the user types 1b int x; scan_hex(&x); print_decimal(x); MODIFY THIS CODE // function inputs a non-negative integer and stores it into *xptr. // The format of the input is...
write C code that uses pointers, arrays, and C strings. 3. Write a function called pow_xy. The function should be passed 2 parameters, as illustrated in the prototype below. int pow_xy(int *xptr, int y); Assuming that xptr contains the address of variable x, pow_xy should compute x to the y power, and store the result as the new value of x. The function should also return the result. Do not use the built-in C function pow. For the remaining problems,...
answer in c++ Using the table below, complete the C++ code to write the function prototype statement, and the void function header. The void function should receive three double variables: the first two by value and the last one by reference. Name the formal parameters num1, num2 and answer. The function should divide the num1 variable by the num2 variable and then store the result in the answer variable. Name the function calcQuotient. Also write an appropriate function prototype for...
pUI) FOU are to write a function which has a prototype: void count (char sl, int *pUpper, "pLower, "poigit, pother) s [ is a character string which may be of any length. Other arguments are address of where the number of upper, lower, digits, and other characters in the string should be placed. For example (this is only an example) the code (put into a properly written program): char all "12145-9ABD, 3f0 :bbB2" char bll "148x3!!" char c[] = {...