اخوانى السلام عليكم
عملت برنامج لايجاد متوسط 50 رقم وبعد ايجادهم يقوم بعرض الـ 50 رقم الذين تم ادخالهم ولكن البنامج لا يعمل فارجو معرفة اين الخطا
وجزاكم الله خيرا
#include <iostream.h>
#include <conio.h>
int main() {
float a,total,avg;
int i;
for (i =0;i<50;i++)
{
cout <<"plz enter the value";
cin >> a;
total = total+a;
}
avg = total/50.0;
cout <<"the avg = " <<avg;
cout << "the values are:";
for (i=0;i<50;i++)
cout <<a;
getch();
return 0;
}