Posts

Showing posts from November, 2016

पास्कल त्रिकोण के लिए c++ में program कैसे बनाना है

Image
इस सी ++ प्रोग्राम जो पास्कल त्रिकोण प्रिंट। कार्यक्रम इनपुट के रूप में पंक्तियों की संख्या लेता है और पास्कल त्रिकोण मुद्रित करने के लिए नेस्ट छोरों का उपयोग करता है। पहली भीतरी लूप खरोज जगह बनाता है और दूसरा भीतरी लूप द्विपद गुणांक का मान की गणना करता है, खरोज जगह बनाता है और उस विशेष स्तंभ के लिए द्विपद गुणांक प्रिंट। यहां सी ++ प्रोग्राम है जो पास्कल त्रिकोण प्रिंट के स्रोत कोड है। सी ++ कार्यक्रम को सफलतापूर्वक संकलित और एक लिनक्स सिस्टम पर चलाया जाता है। कार्यक्रम उत्पादन भी नीचे दिखाया गया है। #include<iostream> using namespace std;   int main() {     int rows;     cout << "Enter the number of rows : ";     cin >> rows;     cout << endl;       for (int i = 0; i < rows; i++)     {         int val = 1;         for (int j = 1; j < (rows - i); j++)         {        ...

How to make pascal's triangle using for loop in c++

Image
This C++ Program which prints pascal’s triangle. The program takes number of rows as input and uses nested loops to print pascal’s triangle. The first inner loop creates the indentation space and the second inner loop computes the value of binomial coefficient, creates indentation space and prints the binomial coefficient for that particular column. Here is source code of the C++ program which prints pascal’s triangle. The C++ program is successfully compiled and run on a Linux system. The program output is also shown below. IF YOU ARE USING MODERN COMPILERS LIKE DEV C++ AND CODEBLOCK S #include<iostream> using namespace std; int main() {     int rows;     cout << "Enter the number of rows : ";     cin >> rows;     cout << endl;     for (int i = 0; i < rows; i++)     {         int val = 1;         for (int j = 1; j < ...