If after addition, you have to divide by the third number, you need more than 3 variables. Why is that? can anyone please help me with this problem. it will be very grateful.why do we need to after addition, you have to divide by the third number, you need more than 3 variables. Why is that? thank you
#include <stdio.h>
class res
{
int a[6],i;
public:
int result()
{
for(i=0;i<3;i++)
{
if(a[i]%3==0)
{
"sum=sum+a[i]";
}
}
}
}; // Added newly
int main()
{
res r;
int i,a[5];
cout<<"enter three numbers";
for(i=0;i<3;i++)
{
cin>>a[i]);
}
r.result();
return 0;
}