Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions