जब C++ प्रोग्राम में किसी स्टेटमेण्ट पर ऐसी स्थिति आती है कि वहाँ से आगे बढ़ने के लिए एक से अधिक मार्ग होते हैं तो ऐसी स्थिति ब्रांचिंग कहलाती है। ब्रांचिंग स्थिति को हल करने के लिए ब्रांचिंग कण्ट्रोल स्टेटमेण्ट का प्रयोग किया जाता है, जो निम्न हैं।
⦁ if स्टेटमेण्ट
⦁ if-else स्टेटमेण्ट
⦁ switch स्टेटमेण्ट
दी गई संख्या सम है या विषम, जानने के लिए प्रोग्राम
#include<iostream.h>
void main( )
{
int num;
cout<<"Enter the number:";
cin>>num;
if (nurm2 == 0)
cout<<"The number is Even";
else
cout<<"The number is Odd";
}
आउटपुट
Enter the number : 25
The number is Odd