Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- #include<string>
- int main()
- {
- int number[100][100];
- int row, colum,x,counter=0;
- cout << "enter number of row:" << endl;
- cin >> row;
- cout << endl;
- cout << "enter number of cilume:" << endl;
- cin >> colum;
- cout << endl;
- for (int i = 0; i < row; i++)
- {
- for (size_t j = 0; j < colum; j++)
- {
- x = i + j+1;
- number[i][j] = x;
- }
- }
- for (int i = 0; i < row; i++)
- {
- for (size_t j = 0; j < colum; j++)
- {
- if (number[i][j]%2!=0)
- {
- cout << number[i][j] << " ";
- counter++;
- }
- }cout << endl;
- }
- cout << "your odd number is" << counter;
- cout << endl;
- system("pause");
- }
Add Comment
Please, Sign In to add comment