رد: واجب البرمجــه ؟؟
هلا حبيبتي انا حليته بif وترى عادي حقوق الطبع مو محفوظه >>>int Grenache;
int x;
char city;
cout<<"city\tcode\n\n";
cout<<"jeddah\tj\n";
cout<<"makkah\tm\n";
cout<<"cairo\tc\n";
cout<<"enter your choice:";
cin>>city;
cout<<"enter the time in grenache:";
cin>> Grenache;
if(Grenache>=1 && Grenache<=24)
{
if(city='j')
{
x=(Grenache+3)
if (Grenache>=1 && Grenache<12)
cout<<"the time in jeddah: "<<x <<"a.m.";
else
cout<<"the time in jeddah: "<<x <<"p.m.";
}
else if(city='m')
{
x=(Grenache+3);
if (Grenache>=1 && Grenache<12)
cout<<"the time in makkah: "<<x <<"a.m.";
else
cout<<"the time in makkah: "<<x <<"p.m.";
}
else
{
x=(Grenache+2);
if (Grenache>=1 && Grenache<12)
cout<<"the time in cairo: "<<x <<"a.m.";
else
cout<<"the time in cairo: "<<x <<"p.m.";
}
}
else
cout<< "wrong entry not in the range of 1 to 24";
getch();
}
|