
01-15-2008, 08:29 AM
|
 |
Moderator
|
|
تاريخ التسجيل: Dec 2004
الدولة: أبوظبي - الإمارات
المشاركات: 601
|
|
<div class='quotetop'>إقتباس(delpiero @ 15-01-2008, 12:13) <{POST_SNAPBACK}></div>
اقتباس:
كود:
// 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[/b]
|
صحيح .. في Xcode 3 قم باختيار Console من القائمة Run.. اعذرني أخي.. وقم بعد ذلك بعمل التنفيذ كالعادة.
__________________
أبو بكر
|