#include <iostream.h>
#include <conio.h>
int main ()
{
cout<< "Enter number: " ;
cin>> num[i];
sum = sum + num[i];
}
average = sum / 5.0;
cout<< "Sum is: "<< sum;
cout<< "Average is: "<< average;
return 0;
}
{
int num[5] , i , sum = 0 ;
float average = 0.0 ;
for (i = 0; i < 5; i++)float average = 0.0 ;
{
cout<< "Enter number: " ;
cin>> num[i];
sum = sum + num[i];
}
average = sum / 5.0;
cout<< "Sum is: "<< sum;
cout<< "Average is: "<< average;
return 0;
}
No comments:
Post a Comment
If you have any doubt please let me know