following is code for calculating average of  3 variableswith user input and without.


  • code with user input:-


#include<iostream.h>
void main()
{
int a,b,c;
float d;
cout<<"enter the value of a,b,c";
cin>>a>>b>>c;
d=(float)(a+b+c)/3;
cout<<"Average of 3 variables is ="<<d;
}



  • code without user input:-


#include<iostream.h>
void main()
{
int a,b,c;
float d;
a=10;
b=17;
c=15;
d=(float)(a+b+c)/3;
cout<<"Average of 3 variables is ="<<d;
}


note:-it's just a sudo code if its not executing on your device make some changes in the further code this is only for understanding logic.

thankyou for visiting us stay tuned for learning and more intresting u can ask questions in comment section check other blogs for more info. comment mail for compitative cading thankyou.👍😎🙏