24-10-2010, 11:13 PM
|
#4
|
تاريخ التسجيل: Jul 2008
كلية: كلية الحاسبات وتقنية المعلومات
التخصص: IT
نوع الدراسة: عضو هيئة تدريس
المستوى: متخرج
البلد: جــــدة
الجنس: ذكر
المشاركات: 2,477
|
رد: mr.Ahmad .. pleas
كود:
#include <stdio.h>
#include <conio.h>
#include <math.h>
main void ()
{ int H1,H2,H3,H4,M1,M2,M3 ;
printf(" please enter the time of the flight %d%d",H1,M1);
scanf("%d%d",H1,M1);
printf("please enter how long the flight take%d%d",H2,M2);
scanf("%d%d",H2,M2);
(H3 = H1+H2);
if (H3 <=12)
{
printf("you will reach the city at %d",H3);
printf("a.m");
}
if else ( H3>12)
{
H3=(H1+H2)-12 ;
printf("you will reach the city at %d",H3);
printf("p.m");
}
M3 = M1 + M2 ;
if ( M3<60);
printf (%d,&M3);
else if ( M3>=60)
printf("( M1+M2)-60"),M3 ;
printf("H1+H2+1",H3);
getch ();
}
هل من الممكن معاينة كودي ؟
يطلع لي ان في خطأ واحد في الـ main void !
|
تم تعديل الأخطاء النحوية ,, ولكن توجد هناك أخطاء أخرى في منطق البرنامج :
كود:
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main ()
{
int H1,H2,H3,H4,M1,M2,M3 ;
printf(" please enter the time of the flight %d%d",H1,M1);
scanf("%d%d",H1,M1);
printf("please enter how long the flight take%d%d",H2,M2);
scanf("%d%d",H2,M2);
(H3 = H1+H2);
if (H3 <=12)
{
printf("you will reach the city at %d",H3);
printf("a.m");
}
else if ( H3>12)
{
H3=(H1+H2)-12 ;
printf("you will reach the city at %d",H3);
printf("p.m");
}
M3 = M1 + M2 ;
if ( M3<60)
{
printf ("%d",M3);
}
else if ( M3>=60)
{
printf("( M1+M2)-60"),M3 ;
printf("H1+H2+1",H3);
}
getch ();
}
عدلي الذي باللون الأحمر .
|
|
سبحان الله وبحمد ,,, سبحان الله العظيم الحمد لله كما ينبغي لجلال وجهه وعظيم سلطانه . اللهم صل على محمد وعلى آل محمد كما صليت على إبراهيم وعلى آل إبراهيم إنك حميد مجيد . اللهم بارك على محمد وعلى آل محمد كما باركت على إبراهيم وعلى آل إبراهيم إنك حميد مجيد.
|
|
|
|