عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 17-03-2010, 09:02 PM

galaxy55 galaxy55 غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Mar 2010
التخصص: cs
نوع الدراسة: إنتظام
المستوى: الثاني
الجنس: أنثى
المشاركات: 23
Unhappy كم سوال يحتاجو لجواب


Q1: What is wrong with this code?

1. if ( tall == 180); cout << “ You are taller than me!”;
--------------------------------
Q2: What is the output of the following code?
int n=1; if (n=0) cout << "n = 0"; else cout << "n = " << n;
1. n = 0
2. n = n
3. n = 1
4. error
5. n =

-------------------------------------

Q3: Write and run a program that read’s user’s age and then prints:
“You are a child” if the age < 18
“You are adult” if 18 ? age< 65
“You are a senior citizen” if age ? 65

---------------------------------------------

Q4: Write a C++ program to calculate the square root of a user-entered number.
Hint: Before calculating the square root, you should validate that the number is not
negative.
رد مع اقتباس