السلام عليكم و رحمة الله و بركاته
شكرا لجهودكم و أتمنى مساعدتي في هذا البرنامج "
Write a program to prompt the user to enter 10 elements and store them in an array, then find the sum of all the elements in an array and print the sum
كتبت البرنامج بهذه الصيغة :
كود:#include<iostream> #inlude<conio.h> using std :: cout; using std ::endl; #include<iomanip> using std ::setw; int main () { int n[10]; for (int i=0;i<arraysize;i++) n[i]=5*i cout<<"element"<<setw(15)<<"value"<<endl; getch(); return 0; }
البرنامج للأسف فشل ..و كيف أضيف عملية الجمع
من لديه الخبرة فليساعدني و له الأجر
و شكرا لكم
المفضلات