#include <iostream>
using namespace std;
int main()
{
double avg,sum=0,counter=0;
for(int j=1;j<=100;j++)
{
if(j%3==0)
{
counter++;
sum=sum+j;
}
}
avg=sum/counter;
cout << "The Average is = "<<avg<<endl;
return 0;
}
using namespace std;
int main()
{
double avg,sum=0,counter=0;
for(int j=1;j<=100;j++)
{
if(j%3==0)
{
counter++;
sum=sum+j;
}
}
avg=sum/counter;
cout << "The Average is = "<<avg<<endl;
return 0;
}
0 comments:
Post a Comment
Thanks For Your FeedBack....