Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 165 - CoreGPT(Podar)_Flipbook_C8
P. 165

    cout<< "The new value of a is: " << a << "\n";
                               b = ++b;
                               cout<< "The new value of b is: " << b << "\n";
                               a = a * --b;
                               cout<< "The new value of a is: " << a << "\n";
                               a = a + 154;
                               cout<< "The new value of a is: " << a << "\n";
                               b = a++ * b;
                               cout<< "The new value of b is: " << b << "\n";
                             getch();
                           }

                          Write a C++ program to calculate the perimeter of an equilateral triangle.

                     Teacher's Note

                       1.  Discuss all the fundamental concepts of C++ with the students.
                       2.  Explain the use of different types of operators provided by C++ to the students.
                       3.   Discuss the requirement of typecasting with the students.
                       4.   Discuss all the conditional statements provided by C++ with the students.
                       5.   Explain the difference between switch and if…else…if ladder to the students.

                                                                                      Developing Programs in C++        163

| 160 161 162 163 164 165 166 167 168 169 170 |