Page 31 - Modular_V2.0_C++_Flikpbook
P. 31

E.   Long answer type questions.
                      1.  What is the use of cout object? Give an example.

                      2.  What is difference between cout and cin objects?

                 F.   What will be the output of the following codes?
                      1.  cout<<"Hello\t";                                   2.   int age;

                          cout<<"Touchpad";                                       cout<<"Enter your age: ";
                                                                                  cin>>age;
                                                                                  cout<<age;




                                                       In the lab                         21 st  Century   #Critical Thinking
                                                                                             Skills

                     Write a C++ program to:
                         Accept your first name and last name as input and display them as your full name.

                         Accept your marks of five subjects as input and display the percentage you have scored.
                         Accept distance in kilometre and convert it into metres and centimetres.





                  Teacher's Corner

                 Do a walk-through of all the topics discussed in the chapter.








































                                                                                                                  29
                                                                                          Input and Output in C++
   26   27   28   29   30   31   32   33   34   35   36