الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

سؤال؟؟؟

مغلق
بدأه مبتدئة سي ++ في 20 مارس 2003 · 1 رد · 473 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

أتمنى مساعدتي في هذا السؤال .

write the program that includes alogical operator in its if to determine wether the age is greater than 10 and less than 100 if the age is less than 10 or greater than 100 ,the program includes that the user did not enter avalid age

وهذه محاولتي

#include<iostream.h>

int main()

{



float Age;

cout<<"enter your Agen";

cin>>Age;

if((Age>10)(Age<100))

cout<<Age<<"n";

if((Age<10)(Age>100))

cout<<"did not enter avalid age";

return o;

}

////التعديل الذي أجريته فقط لإظهار الكود بوضوح إسماعيل ابراهيم ////////

#2

التصحيح....

#include<iostream.h>

int main()

{



float Age;

cout<<"enter your Agen";

cin>>Age;

if((Age>10&& Age<100)// "نتبه لإستخدام  "و

cout<<Age<<"n";

if(Age<10||Age>100)//"إنتبه لإستخدام "أو

cout<<"did not enter avalid age";

return 0;//                 Not return O !;

}

هذا الموضوع مغلق.

مواضيع مشابهة