TRENDING NEWS

POPULAR NEWS

Write A Program In C To Input Data Into Table Having 2 Rows And 2 Columns. Calculate The Sum And

How can you write a C program to compute the sum and average of a 5 integer number?

A2A.#include
#include
void main() {
int a[5],sum=0,i;
float avg;
for(i=0;i<5;i++) {
printf("Enter any 5 numbers: ");
scanf("%d",&a[i]);
sum+=a[i];
}
avg=sum/5;
printf("Sum = %d",sum)
printf("Average = %f",avg);
getch();
}

Write a program in c++ to input data into table having 2 rows and 2 columns. calculate the sum and average on the screen?

i got this but there are some errors kindly help me

#include
#include
#include

public static void main(String[] args)
{
int[][] iMat = new int[2][2];

int sum = sumTable(iMat);
int Ave = sumTable(iMat);

}

public static int sumTable(int[][] mat)
{
int total = 0;

for (int i = 0; i < mat.length; i++)
for (int j = 0; j < mat.length; j++)
total += mat[i][j];
Ave== total/2

}
return total;
}

Write a c program to add two matrix where row and column are given at command line?

#include#include int main() {   int i, j, mat1[10][10], mat2[10][10], mat3[10][10];   int row1, col1, row2, col2;   printf("\nEnter the number of Rows of Mat1 : ");   scanf("%d", &row1);   printf("\nEnter the number of Cols of Mat1 : ");   scanf("%d", &col1);   printf("\nEnter the number of Rows of Mat2 : ");   scanf("%d", &row2);   printf("\nEnter the number of Columns of Mat2 : ");   scanf("%d", &col2);   if (row1 != row2 || col1 != col2) {      printf("\nOrder of two matrices is not same ");      exit(0);   }   //Accept the Elements in Matrix 1   for (i = 0; i < row1; i++) {      for (j = 0; j < col1; j++) {         printf("Enter the Element a[%d][%d] : ", i, j);         scanf("%d", &mat1[i][j]);      }   }   //Accept the Elements in Matrix 2   for (i = 0; i < row2; i++)      for (j = 0; j < col2; j++) {         printf("Enter the Element b[%d][%d] : ", i, j);         scanf("%d", &mat2[i][j]);      }   //Addition of two matrices   for (i = 0; i < row1; i++)      for (j = 0; j < col1; j++) {         mat3[i][j] = mat1[i][j] + mat2[i][j];      }   //Print out the Resultant Matrix   printf("\nThe Addition of two Matrices is : \n");   for (i = 0; i < row1; i++) {      for (j = 0; j < col1; j++) {         printf("%d\t", mat3[i][j]);      }      printf("\n");   }   return (0);}

How can I write a C program to find the sum of two one-dimensional array and store it in another variable?

You can store that into a variable#include
using namespace std;

int main()
{
int sum;
int a[2]={1,2};
int b[2]={3,4};
for (int i=0; i<2 ;i++)
{
sum+=a[i]+b[i];
}
cout<<"sum of two 1D array is ="< return 0;
}

Calculate running total and displayed in each row?

here is a simple html and javascript. when the value changes for one of the input files and you press enter, it calculates the sum. if you want it to calculate the sum while typing, you should use ajax.
















How to write a program to perform multiplication of two 3×3 matrices in C?

WRITE A PROGRAM TO ACCEPT TWO N X N MATRIX AND PRINT THEIR MULTIPLICATIONSOLUTION:#include
#include
int main()
{
int i,j,m,n,k,a[5][5],b[5][5],c[5][5];

printf("Enter order of matrix :\n");
scanf("%d%d",&m,&n);
printf("Enter matrix elements of first matrix :\n");
for(i=0;i for(j=0;j scanf("%d",&a[i][j]);

printf("Enter matrix elements of second matrix : \n");
for(i=0;i for(j=0;j scanf("%d",&b[i][j]);

for(i=0;i for(j=0;j {
c[i][j]=0;
for(k=0;k c[i][j]=c[i][j]+a[i][k]*b[k][j];
}

printf("Resultant matrix : \n");
for(i=0;i {
for(j=0;j printf("%d ",c[i][j]);
printf("\n");
}
getch();
}

OUTPUT :Enter order of matrix :
3 3
Enter matrix elements of first matrix :
1 2 3
1 2 3
1 2 3
Enter matrix elements of second matrix :
1 2 3
1 2 3
1 2 3
Resultant matrix :
6 12 18
6 12 18
6 12 18
For more download android free app:https://play.google.com/store/ap...

Write a c++ program to find the sum of odd numbers in 2D-array?

include
using namespace std;
void main()
{
int sum=0,arr[10][5]; //example array
for (int i=0;i<10;i++){
for (int j=0;j<10;j++){
if arr[i][j]%2!=0 sum+=arr[i][j];
}
}
cout<}
This above mentioned code should solve your problem

How do I add a calculated field in an Excel pivot table that will divide the sum of one field against the count of another field?

Let’s say you have this data set consist of Art Gallery Exhibition data below. And you want to calculate the Sum of Issue Price/Count of Release DateThe tricky part of this question is to calculate the count of the Release DateA general rule of thumb when facing trouble with calculation field in Pivot table is to go back to the original data table and add more calculation columns. Here I add “Count” column to calculate the number of items on each row.Then, we’ll re-generate the Pivot Table using the data range including this newly added column.Now, we can add new Calculated Field to calculate Sum of Issue Price/Count of Release DateHere are the general steps:How to add/create Calculated Fields in Pivot TableThe Calculated Fields can be added one by one following these steps.To insert a Calculated Field, execute the following steps.Click any cell inside the pivot table.On the Analyze tab, in the Calculations group, click Fields, Items & Sets.Click Calculated Field.The Insert Calculated Field dialog box appears.4. Enter Name of Calculated Field5. Type the formula6. Click Add.Note: use the Insert Field button or double click on the field title to quickly insert fields when you type a formula. In our case, we want to enter the following formula:7. Click OK.Excel automatically adds the Calculated Field to the Values area of Pivot Table.Calculated field is a powerful feature of Pivot Table, you can add, subtract multiply two or more fields, average, weighted average, even IF statements to make calculations.If you still have trouble with your calculation, there is a service to get a live 1:1 Excel help with an Excel expert. You can share your file, too. They offer 1 free session for all new customers. GET A FREE SESSION! Join your friend on ExcelchatGood luck!

How do I convert multiple column data into a column with multiple rows in excel?

Apologies. I can’t really see the writings clearly, but I’m assuming that you want to unpivot the column headers as part of the data set.Here I am suggesting a solution using Microsoft Excel’s Power Query feature. If you have Excel 2016, the feature is found under Data | Get & Transform ribbon command. Otherwise if you have Excel 2013 or the Professional Plus version of 2010, you can download the Power Query add-in from here.Step 1: Select all the data, press Ctrl+T to create a table, and under Create Table, make sure that My table has headers is selected.Step 2: In Excel 2016, go to Data | Get & Transform | From Table. For Power Query add-in for Excel 2013 and 2010, look for something in the Power Query tab ribbon that says From Table.Step 3: The Power Query interface will open up. Click on the header of No. Column, hold Ctrl and click on the header of the Name Column. With both columns now selected, right click on the headers and select Unpivot Other Columns.Step 4: Notice that the data is now unpivoted (which is what you wanted). Double click on the Attribute and Value headers to rename them.Step 5: Click Home | Close & Load.Step 6: Excel will load the new cleaned up table onto a new sheet. Ta-da you’re done!To update any new data in the future:Supposed you now have new data in your original table.Go to the new cleaned up table, right click and select Refresh.The new data will be updated immediately.

TRENDING NEWS