Professional Documents
Culture Documents
Submitted to .Haymanot.
1 . write a c++ code which that read 3x2 matrix and calculate
the sum of each row and store in one dimensional array
#include <iostream>
int main() {
int matrix[3][2];
int row_sums[3];
cout << "Enter element (" << i+1 << "," << j+1 << "): ";
int row_sum = 0;
row_sum += matrix[i][j];
row_sums[i] = row_sum;
return 0;
#include <string>
int main() {
string name;
int count = 0;
getline(cin, name);
for (int i = 0; i < name.length(); i++) {
char ch = tolower(name[i]);
count++;
return 0;
3.writedevelops a c++ code that accept the word from the user
and then display the word after reversing it ?
#include <iostream>
#include <string>
int main() {
string word;
reversed_word += word[i];
return 0;
}
OUT PUT
1