Question: 1. Define a C structure Covid19Info to store the information of COVID 19 cases of countries around the world. It keeps the name of the
1. Define a C structure Covid19Info to store the information of COVID 19 cases of countries around the world. It keeps the name of the country, number of COVID 19 cases, number of deaths, current test positive rate, etc. After defining the structure, declare a variable of Covid19Info type with some initial values for Bangladesh. [8] 2. Define a C function void placeElements (int *a, int i, int j) that inter-exchange the array elements at index i andj. For all = {5, 7, 4,2,1), a call to placeElements (a, 2, 4) makes a[] = {5,7,1,2,4}. [8] 3. Define a function char* changeSymbol (char *s, char x, char y) that changes the character x to character y of string 3. For 3 [] = "nouth", a call to changeSymbol (s, 'n', 'S') converts 3 [] = "South". [8] 4. Write a C program segment that opens a file named country-list.txt in text mode and reads first 10 lines from the file and display the lines for the users. When this file is not available, show appropriate error information to the user. [8] 5. Define a function void resetItems (int n, int m[n] [n], int flag) that sets the upper or lower diagonal elements of 2D array, m to zero (0) based on the value of flag as given below. Here, m represents a square matrix with n number of rows and columns. See the sample input-output below. [8] when flag = 1 when flag = 0 2 5 3 2 5 3 2 5 3 1 1 7 8 2 2 0 0 4 9 0 49 7 8 2 49 7 8 2 0 9 1 0 0 2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
