Guest User

Untitled

a guest
Oct 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. #include<string>
  4. int main()
  5. {
  6. int number[100][100];
  7. int row, colum,x,counter=0;
  8. cout << "enter number of row:" << endl;
  9. cin >> row;
  10. cout << endl;
  11. cout << "enter number of cilume:" << endl;
  12. cin >> colum;
  13. cout << endl;
  14.  
  15. for (int i = 0; i < row; i++)
  16. {
  17. for (size_t j = 0; j < colum; j++)
  18. {
  19. x = i + j+1;
  20.  
  21. number[i][j] = x;
  22.  
  23. }
  24. }
  25.  
  26. for (int i = 0; i < row; i++)
  27. {
  28. for (size_t j = 0; j < colum; j++)
  29. {
  30. if (number[i][j]%2!=0)
  31. {
  32. cout << number[i][j] << " ";
  33. counter++;
  34. }
  35. }cout << endl;
  36. }
  37. cout << "your odd number is" << counter;
  38. cout << endl;
  39.  
  40.  
  41.  
  42. system("pause");
  43. }
Add Comment
Please, Sign In to add comment