السلام عليكم ورحمة الله
هذا سؤال في الهوم وورك وهذي صيغة السؤال:
Write a C++ program to calculate Sum, Average, Subtraction, Multiplication and Division of 2 numbers and 3 numbers.
محاولتي
# include<iostream.h>
int main()
{
double num1,num2,num3,sum1,sum2,average1,average2,sub1,sub2,mul1,mul2,div1,div2 ;
cout<<"enter the first number\n";
cin>>num1;
cout<<"enter the second number\n";
cin>>num2;
cout<<"enter the third number\n";
cin>>num3;
sum1=num1+num2;
sum2=num1+num2+ num3;
average1=(num1+num2)/2;
average1=(num1+num2+ num3)/3;
sub1=num1-num2;
sub1=num1-num2- num3;
mul1=num1*num2;
mul1=num1*num2*num3;
div1= num1/num2;
div1= num1/num2/num3;
cout<<"Subtraction of first two numbers"<<num1<<" and "<<num2<<" is :"<<sub1"<<endl;
cout<<"Subtraction of three numbers "<<num1<<" and "<<num2 <<" and "<< num3<<" is :"<<sub"<<endl;
cout<<"average1 of first two numbers "<<num1<<" and "<<num2 <<" is :"<< average1"<<endl;
cout<<"average1 of three numbers "<<num1<<" and "<<num2 <<" and "<< num3" is :"<< average1"<<endl;
cout<<"Multiplication of first two numbers "<<num1<<" and "<<num2 <<" is :"<<mul1"\n;
cout<<"Multiplication of the three numbers "<<num1<<" "<<num2<<" and "<< num3<<" is :"<<mul2"<<endl;
cout<<"Divition of first two numbers "<<num1<<" and "<<num2 <<" is :"<<div1"<<endl;
cout<<"Divition of three numbers "<<num1<<" and "<<num2 <<" and "<< num3" is :"<<div2"<<endl;
return 0;
}فيه أخطاء بس ما عرفت مكان الخطأ بالضبط

