السلام عليكم و رحمة الله و بركاته
كيف الحال يا شباب
انا اصراحه ما عرضت مشكلتي هنا الا بعد ما سمعت عن هذا المنتدى
عندي برنامج لازم اسويه
هو برنامج بسيط لاني انا مبتدأ
Problem #1
Write a program that displays the squares, cubes, and fourth powers of the numbers 1 through 5.
دخت الى اني طفشت ما عرفت كيف الحل.
و البرنامج الثاني:
Problem #2
Write a program that asks the user for the lengths of the sides of a rectangle. Then prints
The area of the rectangle
The length of the diagonal
و حلي هو:
#include <iostream.h>
int main()
{
double lenght,width;
cout << "What is the lenght of the rectangle? ";
cin >> lenght;
cout << "What is the width of the rectangle? ";
cin >> width;
double area = lenght * width;
cout << "The area of the rectangle is " << area << "\n";
cout << "The length of the diagonal = " << sqrt(width*width+lenght*lenght) << "\n";
return 0;
}
المشكلة في السطر الي لونه احمر
لما امسح كلمه sqrt البرنامج تشتغل معي تمام
و لما اسيبها في البرنامج و اعمل ترجمة يكتب لي يوجد خطأ
و كلمة sqrt تعني الجذر التربيعي
و كمان المشكلة تحصل معي لما ابغى اسوي الاس
الي هو pow(x,5.0)
و السلام عليكم و رحمة الله و بركاته
