Page 17 - مجلة طموح IT
P. 17

BASICS
                                INPUT
                              OUTPUT

              ‫ ملائم لأداء عمليات الادخال والاخراج لسلسلة من الوسائط مثل الشاشة ولوحة المفاتيح والفايلات‬stream ‫ تستخدم‬++c ‫ان‬
                                                                                          )Standard Output (cout

            )<<(insertion operator ‫ مع علامة‬cout ‫واحدة من البيئات الاساسية لعرض المخرجات على الشاشة بصورة طبيعية وتستخدم ال‬

cout << "Output sentence"; // prints Output sentence on
screen
cout << 55;  // prints number 55 on screen
cout << x;   // prints the value of x on
screen

                                                         ‫ممكن كتابة اكثر من جمله بنفس الامر‬

name="zaki"
hours=5
cout << "hi I'm "<< name<<" I study for "<<hours<<" hours
in the day"; // prints hi I'm zaki I study for 5 hours in
the day

                                                                                            Standerd Input cin
                                              ‫في اغلب البرامج المدخلات تاتي من لوحة المفاتي ٌح و ٌمكن الوصول الي ٌها عبر هذا الامر‬

Int num ; // define avatiable
cin>>num; //wait the user to enter the value

‫اسيل سعد‬                                    17
   12   13   14   15   16   17   18   19   20