وديّ بمسآعدتكم لي في كتآبة برنآمج يطلب من اليوز يدخل رقمين صحيحين
ونستخدم فيه 4 function
- Add( ) - Subtract( ) - Multiply( ) - Divide( )
Each function should receive two integers as parameter
These shouldn't return anything
والمخرجآت لآزم تكون كذآ
Welcome To Calculator Program
Pleas Enter first number
10
Pleas Enter second number
5
The sum of your numbers 15
The subtract of your numbers 5
The multiply of your numbers 50
The divide of your numbers 2
هذه محآوله لكن المخرجآت البآقيه مآطلعت لي// يـ ليت تفيدوني بـ أسرع وقت
#include<iostream.h>
using namespace std;
void add(int n1,int n2)
{
cout<<n1+n2;
}
void sub(int n1,int n2)
{
cout<<n1-n2;
}
void mult(int n1,int n2)
{
cout<<n1*n2;
}
void divide(int n1,int n2)
{
cout<<n1/n2;
}
int main()
{
int num1;
int num2;
cout<<"Welcome to Calculator Program\n";
cout<<"\nplease Enter first number ";
cin>>num1;
cout<<"\nplease Enter second number ";
cin>>num2;
cout<<"\nthe sum of your numbers = ";
add(num1,num2);
cout<<"\nthe subtract of your numbers = ";
sub(num1,num2);
cout<<"\nthe multiply of your numbers = ";
mult(num1,num2);
cout<<"\nthe divide of your numbers = ";
divide(num1,num2);
return 0;
}المخرجآت الليّ ظهرت لي :
Welcome to Calculator Program
please Enter first number
أيش نآقصني عشآن تطلع كل المخرجآت المطلوبه ؟!