كود:
// This is my first C application in Xcode
// Abo Baker { habib}
int add (int a, int b)
{
return a + b;
}
int subtract (int a, int b)
{
return b - a;
}
long mul (int a, int b)
{
return a * b;
}
double divide (int a , int b)
{
return a / b;
}
int main()
{
int x=10,y=5;
int result;
double r;
printf("%s", "\n\n =========================================================== \n");
printf("%s", "= This is my first C application on Macintosh using Xcode =\n");
printf("%s", "===========================================================\n\n");
printf("%s", "Adding two values... x = 10, y = 5\n");
result = add (x, y);
printf("%s%d%s" , " ... Answer = ", result,"\n");
printf("%s", "\n\nSubtracting two values... x = 10, y = 5\n");
result = subtract (x, y);
printf("%s%d%s" , " ... Answer = ", result,"\n");
printf("%s", "\n\nMultiplying two values... x = 10, y = 5\n");
result = mul (x, y);
printf("%s%d%s" , " ... Answer = ", result,"\n");
printf("%s", "\n\nDividing two values... x = 10, y = 5\n");
result = divide (x, y);
printf("%s%d%s" , " ... Answer = ", result,"\n");
return 0;
}
استاذ ابو بكر
انا كودي هذا ولمنن انفذ البرنامج يطلع لي سكسيد
ومافي ايرور
بس ما تطلع الوندوز الي قلت عنها بعد ما اسوي Bulid and run