YounusShalaby

الأعضاء
  • المساهمات

    1
  • تاريخ الانضمام

  • تاريخ آخر زيارة

  • Days Won

    1

السُّمعة بالموقع

1 Neutral
  1. #include <iostream> using namespace std; int main(){ // Defining Array string names[5]; // Read Array for (int i = 0; i < 5; i++){ cin >> names[i]; } // Print Array for (int i = 0; i < 5; i++){ cout << names[i] << ", "; } return 0; } #include <iostream> using namespace std; int main(){ // Defining Array char grades[5]; // Read Array for (int i = 0; i < 5; i++){ cin >> grades[i]; } // Print Array for (int i = 0; i < 5; i++){ cout << grades[i] << ", "; } cout << "\n"; // new Line separated // Print Char >= s && Locations for (int i = 0; i < 5; i++){ if(grades[i] >= 's'){ cout << grades[i] << " in Location ===> " << (int)grades[i]; } } cout << "\n"; // new Line separated // Print Ascii Code for (int i = 0; i < 5; i++){ cout << (int)grades[i] << " - "; } cout << "\n"; // new Line separated return 0; } #include <iostream> using namespace std; int main(){ // Defining Array int grades[4][5]; // Read Array for (int i = 0; i < 4; i++){ for(int j = 0; j < 5; j++){ cin >> grades[i][j]; } } cout << "\nPrint Array\n"; // Print Array for (int i = 0; i < 4; i++){ for(int j = 0; j < 5; j++){ cout << grades[i][j] << ", "; } } cout << "\n"; // new Line separated cout << "\n"; // new Line separated cout << "Print Array In Reverse\n"; // Print Array In Reverse for (int i = 4 - 1; i >= 0; i--){ for(int j = 5 - 1; j >= 0; j--){ cout << grades[i][j] << ", "; } } cout << "\n"; // new Line separated return 0; }