. Write a program using two-dimensional arrays that computes
the sum of data in tows and the sum of data in columns of
the 3x3 (three by three) array variable n[3][3].
Answer Posted / sreejesh1987
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,a[3][3],rowsum[3],colsum[3];
clrscr();
for(i=0;i<3;i++)
rowsum[i]=colsum[i]=0;
printf("Enter numbers:\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
rowsum[i]+=a[i][j];
colsum[j]+=a[i][j];
}
for(i=0;i<3;i++)
printf("RowSum[%d]:%d\n",i,rowsum[i]);
for(i=0;i<3;i++)
printf("Columnsum[%d]:%d\n",i,colsum[i]);
getch();
}
| Is This Answer Correct ? | 28 Yes | 17 No |
Post New Answer View All Answers
write a program that reads a series of strings and prints only those strings begging with letter "b"
How to Split Strings with Regex in Managed C++ Applications?
Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.
We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
1+1/2!+1/3!+...+1/n!
How to swap two ASCII numbers?
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
i don't know about working of nested for loop can any one help me
Write a simple encryption program using string function which apply the substitution method.
Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20