Download as:
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Language:EN
Pages: 3
Words: 662

You are viewing 1/3rd of the document.
Purchase the document to get full access instantly.

Immediately available after payment
Both online and downloadable
No strings attached

Copies the contents the original array denoted ptr the new array

QUESTION 2

The code below is supposed to take an arbitrary number of integers from the input and calculate the mean of the numbers. You are supposed to complete the functions add_array() and get_mean() without changing the code given in the main function.

The main() function is as follows.

int main(){

int n=1;

while(scanf("%d",&d)) {

n++;

}

Output Format: The output is the mean. The output is rounded to two decimal places. The output code is given in the main function snippet.

QUESTION 3

  1. void cyclicShift(char* substr, int len) - Shift substring cyclically towards the right by 2 places. Eg: "abcde" ? "deabc".

  2. void swapCase(char* substr, int len) - Swap the cases of all alphabets in substr. Eg: "Ab2" ? "aB2".

Input Format:

The first line is the input string str (newline is not part of the string). The second line specifies the number of queries q. The next q lines are triplets (type, start, end), representing the transformations you have to carry out in order.

Copyright © 2009-2023 UrgentHomework.com, All right reserved.