السلام عليكم
انا أستخدم برنامج c++ وحليت بعض الأسئله لكن بعضها لم يتنفذ لي بالشكل الصحيح الكومبايلر يقول صحيح لكن عند التنفيذ يكون هناك اخطاء او اخطاء في الرن تايمPosted Image
السؤال هذا حول المصفوفات
Write a program that reads from the user two words (as array of characters) the program
then copies the shortest word into an array and prints the word to the user along with number of characters in the word.
As an example: Word1: “example” Word2: “tutorial”
The program would output: the shortest word is “tutorial” with 8 characters.
وهذا هو حلي ولا أعلم مالمشكله ؟
#include<iostream>
using namespace std;
const int size=15;
int main()
{
char a1[size];
char a2[size];
int j;
int i;
cout<<"enter firts word :"<<endl;
for(i=0;i<=size;++i);{
cin>>a1;}
cout<<"enter secound word :"<<endl;
for(j=0;j<=size;++j);
{cin>>a2[j];
}
if (a1<a2)
cout<<"the shortest word is" <<a1<<" with"<< i<< "characters"<<endl;
else
cout<<"the shortest word is" <<a2<<" with"<< j<< "characters"<<endl;
system("pause");
return 0;
}شاكره ومقدره المساعده والله يعطيكم العافيه :)