BEPROGRAMMING Telegram 1389
سادساً : معاملات الإزاده والانقاص

👈هناك دائماً حاجة في البرمجة إلى زيادة 1 أو طرح 1 . هذه الحالات شائعة لدرجة أن C++ تتضمن عاملين خاصين ينفذان هذه المهمة، يقوم عامل التناقص (--) بطرح 1 من المتغير ويضيف عامل التزايد (++) 1 إليه ، المثال الآتي يبين طريقة الاستعمال:-
++a
a++
معناه إضافة 1 إلى a، ويمكن كتابته بصورة مكافئة على النحو a=a+1 وبالطريقة نفسها يمكن إنقاص 1 من قيمة a على النحو --a أو a-- وهو يكافئ a=a-1.
ومما يجب التنبيه إليه هنا أن هنالك فرق بين ++ a أو a++ فعلى الرغم من كليهما يجمع 1 إلى a إلا أنه عند استعمال ++a تستخرج قيمة التعبير باستعمال قيمة a الحالية قبل زيادتها وينطبق هذا أيضاً على --a وa-- .


#include<iostream.h>
main ( )
{
int c;
c = 5;
cout << c << endl;
cout << c++ <<endl;
cout << c <<endl;
c=5;
cout << c << endl << endl;
cout << ++c << endl;
cout << c << endl;
return 0;
//Continued
}

الخرج من البرنامج:
5
5
6

5
6
6

🖋 م . أحمد قطران

انتهى ....



tgoop.com/Beprogramming/1389
Create:
Last Update:

سادساً : معاملات الإزاده والانقاص

👈هناك دائماً حاجة في البرمجة إلى زيادة 1 أو طرح 1 . هذه الحالات شائعة لدرجة أن C++ تتضمن عاملين خاصين ينفذان هذه المهمة، يقوم عامل التناقص (--) بطرح 1 من المتغير ويضيف عامل التزايد (++) 1 إليه ، المثال الآتي يبين طريقة الاستعمال:-
++a
a++
معناه إضافة 1 إلى a، ويمكن كتابته بصورة مكافئة على النحو a=a+1 وبالطريقة نفسها يمكن إنقاص 1 من قيمة a على النحو --a أو a-- وهو يكافئ a=a-1.
ومما يجب التنبيه إليه هنا أن هنالك فرق بين ++ a أو a++ فعلى الرغم من كليهما يجمع 1 إلى a إلا أنه عند استعمال ++a تستخرج قيمة التعبير باستعمال قيمة a الحالية قبل زيادتها وينطبق هذا أيضاً على --a وa-- .


#include<iostream.h>
main ( )
{
int c;
c = 5;
cout << c << endl;
cout << c++ <<endl;
cout << c <<endl;
c=5;
cout << c << endl << endl;
cout << ++c << endl;
cout << c << endl;
return 0;
//Continued
}

الخرج من البرنامج:
5
5
6

5
6
6

🖋 م . أحمد قطران

انتهى ....

BY مستـ1ــوى حاسوب


Share with your friend now:
tgoop.com/Beprogramming/1389

View MORE
Open in Telegram


Telegram News

Date: |

When choosing the right name for your Telegram channel, use the language of your target audience. The name must sum up the essence of your channel in 1-3 words. If you’re planning to expand your Telegram audience, it makes sense to incorporate keywords into your name. Telegram offers a powerful toolset that allows businesses to create and manage channels, groups, and bots to broadcast messages, engage in conversations, and offer reliable customer support via bots. 5Telegram Channel avatar size/dimensions During the meeting with TSE Minister Edson Fachin, Perekopsky also mentioned the TSE channel on the platform as one of the firm's key success stories. Launched as part of the company's commitments to tackle the spread of fake news in Brazil, the verified channel has attracted more than 184,000 members in less than a month. As the broader market downturn continues, yelling online has become the crypto trader’s latest coping mechanism after the rise of Goblintown Ethereum NFTs at the end of May and beginning of June, where holders made incoherent groaning sounds and role-played as urine-loving goblin creatures in late-night Twitter Spaces.
from us


Telegram مستـ1ــوى حاسوب
FROM American