اقتباسهل هذا الكود يصلح لهذا السؤالإخواني في هذا السؤال طالب design التصميم للكود أنا قريت عن هذا الموضوع في أحد المنتديات يقولوا عند وجود for نستبدلها ب loop for ولا أعرف ماتكملة العملية أرجو المساعدة مع الشكر
Write a program to input a three integer numbers, each of them is between 1 and 1000, and determine whether the first number is the multiple of the other two numbers. Print a message to tell if the first number is the multiple of the other two numbers.
#include <vcl.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
int main()
{
int x, y, z;
cout << "\nplease enter the numbers: ";
cin >> x >> y >> z;
while (x < 1 || x > 1000)
{
cout << "\nplease enter the first number should between 1-1000 : ";
cin >> x;
}
while (y < 1 || y > 1000)
{
cout << "\nenter the second number: ";
cin >> y;
}
while (z < 1 || z > 1000)
{
cout << "\nenter the third number: ";
cin >> z;
}
if (x == y * z)
cout << "\nthe first is amulet of the second and third: ";
else
cout << "\nthe number is not correct: ";
getchar();
system("pause");
return 0;
}
//---------------------------------------------------------------------------وهذا السؤال هل هذا الكود صحيح لهذا السؤال
اقتباسConsider a 5-by-5 array of characters. Write a C++ program to accomplish each of the following operations:
a. Declare the above array.
b. Read the array.
c. Find and print the number of vowels (a,e,o) in the off diagonal of the array.
d. Replace each non-space character in the array by its next character value in the alphabetic order (Example: letter b will be replaced by c, letter M will be replaced by N, and so on).
#include <vcl.h>
#include <iostream>
using namespace std;
int main()
{
int counter = 0;
char array[5][5];
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
cin >> array[j];
}
for (int i = 0; i < 5; i++)
{
int j=0;
for ( j = 0; j < 5; j++)
{
if ( j == 4)
{
if (array[j] == 'a' || array[j] == 'e' || array[j] == 'o')
counter++;
}
}
}
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
if (array[j] != ' ')
array[j]++;
cout << array[j];
}
}
getchar();
return 0;
}
//---------أسف بالغلط مانكتب الموضوع صح
الموضوع هو هل هنالك أخطاء في الأكواد هذه

