C Answers

Questions answered by Experts: 1 680

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Write a program to multiply any two 3 x 3 matrices
Write a program to obtain transpose of a 4 x 4 matrix. The transpose of a matrix is

obtained by exchanging the elements of each row with the elements of the corresponding

column.
Use matrix subtraction to calculate how much longer was the life expectancy of black

and white women than men of the same races in each decade from year 1950 to year

2000. There is no need to store the year data in your matrices—just provide the years in

the output.

a) Input each matrix from user

b) Calculate the matrix difference by calling a function you write called matrix_diff that

will subtract any two 6-by-2 matrices, producing a third 6-by-2 matrix.

c) Display all three matrices with appropriate labels. Your function should calculate the

matrix difference by subtracting each element of the second matrix from the

corresponding element of the first.

United States Life Expectancy at Birth by Sex and Race
Q1. Create a struct called Invoice that a hardware store might use to represent an invoice

for an item sold at the store. An Invoice should include four data members—a part

number (type string), a part description (type string), a quantity of the item being

purchased (type int) and a price per item (type float). Your program should initialize the

four data members. In addition, it should calculate the invoice amount (i.e., multiplies the

quantity by the price per item), If the quantity is not positive, it should be set to 0. If the

price per item is not positive, it should be set to 0. Write a test program that demonstrates

struct Invoice’s capabilities.

Note: Perform this work using

1. 2d array

2. pointer to 2d arrays

3. design function for calculating the results by passing array to function by value and by

reference.

1).

void main( )
{
int x=7, y=5;
x = y++ + x++ ;
y = ++y + ++x;
printf(“%d %d”, x , y);
}

2).

main() { 
 int z, x=5, y=-10, a=4, b=2;
 z = x ++ - --y * b / a;
 printf(“%d %d %d”, x, y, z);
}

3).

int main ( )
{
int i = 7;
for(i-- ;i-- ;i--)
printf(“%d”, i);
return 0;
}

1).

void main ( )
{
int i = i++, j = j++, k = k++;
printf ( “ i = %d j = %d k = %d”, i, j, k );
}

2).

int main ( )
{
int i = 7;
for(i-- ;i-- ;i--)
printf(“%d”, i);
return 0;
}
use a one dimensional array to solve the following problem. read in 20 numbers, each of which is between 10 and 100 inclusively. as each number is read, print it only if its not a duplicate of a number already read. provide for the worst case scenario in which all 20 numbers are different . use the smallest possible array to solve this problem.
conduct a survey from 10 people to discover most popular sport. the result will be typed in to the computer for analysis at the end of the survey analysis the result and disply the most popular sports “type in the letter Q for finish”
A athletes
B swimming
C football
D badminton
Write a Function that outputs
a) The String : The one half is 50%.
b) Two integers and their difference.
c) Two floats and the result of dividing one with the other.
use a while loop that finds the x3 where x = 20...10 (use the order
from 20 to 10 and not 10 to 20)
LATEST TUTORIALS
APPROVED BY CLIENTS